diff --git a/src/opustags.cc b/src/opustags.cc index 960bc47..79c86d2 100644 --- a/src/opustags.cc +++ b/src/opustags.cc @@ -19,10 +19,10 @@ int main(int argc, char** argv) { setlocale(LC_ALL, ""); ot::options opt = ot::parse_options(argc, argv, stdin); ot::run(opt); - return EXIT_SUCCESS; + return 0; } catch (const ot::status& rc) { if (!rc.message.empty()) fprintf(stderr, "error: %s\n", rc.message.c_str()); - return EXIT_FAILURE; + return rc == ot::st::bad_arguments ? 2 : 1; } } diff --git a/src/opustags.h b/src/opustags.h index 900eaa1..eff5f31 100644 --- a/src/opustags.h +++ b/src/opustags.h @@ -96,7 +96,7 @@ enum class st { struct status { status(st code = st::ok) : code(code) {} template status(st code, T&& message) : code(code), message(message) {} - operator st() { return code; } + operator st() const { return code; } st code; std::string message; }; diff --git a/t/opustags.t b/t/opustags.t index d2cae46..6a15f53 100755 --- a/t/opustags.t +++ b/t/opustags.t @@ -44,7 +44,7 @@ sub opustags { # Tests related to the overall opustags executable, like the help message. # No Opus file is manipulated here. -is_deeply(opustags(), ['', <