2018-07-08 19:34:08 -07:00
|
|
|
// This is a small executable that prints its first argument and exits with the exit status in its second argument
|
|
|
|
|
|
|
|
#include <iostream>
|
2018-08-07 18:04:32 -07:00
|
|
|
#include <cstdlib>
|
2018-07-08 19:34:08 -07:00
|
|
|
|
|
|
|
int main(int argc, char* argv[]) {
|
|
|
|
if (argc != 3) {
|
|
|
|
std::cerr << "Wrong number of arguments" << std::endl;
|
2018-08-07 18:04:32 -07:00
|
|
|
std::abort();
|
2018-07-08 19:34:08 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
std::cout << argv[1];
|
|
|
|
|
2019-06-08 13:06:17 -07:00
|
|
|
int exit_status = static_cast<int>(std::strtol(argv[2], nullptr, 10));
|
2018-07-08 19:34:08 -07:00
|
|
|
return exit_status;
|
|
|
|
}
|