diff --git a/sciotest/main.cpp b/sciotest/main.cpp index 817a151..1ad3533 100644 --- a/sciotest/main.cpp +++ b/sciotest/main.cpp @@ -20,9 +20,10 @@ using namespace std; void print_help() { - std::cout << "usage: sciotest [-h][-v][-t TEST_ID]\n"; + std::cout << "usage: sciotest -h|-v|-t TEST_ID\n"; std::cout << " -h, --help show this help text and exit\n"; - std::cout << " -t, --test perform test with given ID\n"; + std::cout << " -t, --test perform test with given TEST_ID\n"; + std::cout << " currently a number between 1 and 5, inclusive\n"; std::cout << " -v, --version show version number and exit\n"; } @@ -88,8 +89,9 @@ void test5() { file << "A line of text\n"; file.seekg(0); string line; - file >> line; - cout << line; + if (getline(file, line)) { + cout << line << '\n'; + } throw_if_min1(::close(fd)); }