From d1fc93b8e851dad37df992fc2e6e07de11870480 Mon Sep 17 00:00:00 2001 From: Tomohiro IKEDA Date: Sat, 21 Mar 2020 03:21:14 +0900 Subject: [PATCH 1/2] fix: Use standard error as output --- source/cli/NFDriverCLI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/cli/NFDriverCLI.cpp b/source/cli/NFDriverCLI.cpp index 0b99851..5aedb71 100644 --- a/source/cli/NFDriverCLI.cpp +++ b/source/cli/NFDriverCLI.cpp @@ -80,7 +80,7 @@ int main(int argc, const char *argv[]) { const std::string samplerate_string = "44100.0"; #else if (argc < 2) { - std::cout << "Invalid number of arguments: ./NFDriver [samplerate]" << std::endl; + std::cerr << "Invalid number of arguments: ./NFDriver [samplerate]" << std::endl; return 1; } const std::string samplerate_string = argv[1]; From 20bd958d82eb938ca1d9c9c3c8032e33a4042ec2 Mon Sep 17 00:00:00 2001 From: Tomohiro IKEDA Date: Sat, 21 Mar 2020 03:25:02 +0900 Subject: [PATCH 2/2] fix: Use `exit` instead of `return` --- source/cli/NFDriverCLI.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/cli/NFDriverCLI.cpp b/source/cli/NFDriverCLI.cpp index 5aedb71..ddaea66 100644 --- a/source/cli/NFDriverCLI.cpp +++ b/source/cli/NFDriverCLI.cpp @@ -20,6 +20,8 @@ */ #include +#include + #define _USE_MATH_DEFINES #include #include @@ -81,7 +83,7 @@ int main(int argc, const char *argv[]) { #else if (argc < 2) { std::cerr << "Invalid number of arguments: ./NFDriver [samplerate]" << std::endl; - return 1; + std::exit(1); } const std::string samplerate_string = argv[1]; #endif