diff --git a/README.md b/README.md index 83cf92f..ecfc6de 100644 --- a/README.md +++ b/README.md @@ -59,9 +59,9 @@ int main(int argc, char *argv[]) { program.parse_args(argc, argv); } catch (const std::runtime_error& err) { - std::cerr << err.what() << std::endl; - std::cerr << program; - std::exit(1); + std::cout << err.what() << std::endl; + std::cout << program; + std::exit(0); } auto input = program.get("square"); @@ -101,9 +101,9 @@ try { program.parse_args(argc, argv); } catch (const std::runtime_error& err) { - std::cerr << err.what() << std::endl; - std::cerr << program; - std::exit(1); + std::cout << err.what() << std::endl; + std::cout << program; + std::exit(0); } if (program["--verbose"] == true) { @@ -167,9 +167,9 @@ try { program.parse_args(argc, argv); // Example: ./main --color orange } catch (const std::runtime_error& err) { - std::cerr << err.what() << std::endl; - std::cerr << program; - std::exit(1); + std::cout << err.what() << std::endl; + std::cout << program; + std::exit(0); } auto color = program.get("--color"); // "orange" @@ -190,9 +190,9 @@ try { program.parse_args(argc, argv); // Example: ./main --color red --color green --color blue } catch (const std::runtime_error& err) { - std::cerr << err.what() << std::endl; - std::cerr << program; - std::exit(1); + std::cout << err.what() << std::endl; + std::cout << program; + std::exit(0); } auto colors = program.get>("--color"); // {"red", "green", "blue"} @@ -238,9 +238,9 @@ try { program.parse_args(argc, argv); } catch (const std::runtime_error& err) { - std::cerr << err.what() << std::endl; - std::cerr << program; - std::exit(1); + std::cout << err.what() << std::endl; + std::cout << program; + std::exit(0); } // Some code to print arguments @@ -271,9 +271,9 @@ try { program.parse_args(argc, argv); } catch (const std::runtime_error& err) { - std::cerr << err.what() << std::endl; - std::cerr << program; - std::exit(1); + std::cout << err.what() << std::endl; + std::cout << program; + std::exit(0); } int input = program.get("square"); @@ -331,9 +331,9 @@ try { program.parse_args(argc, argv); // Example: ./main --input_files config.yml System.xml } catch (const std::runtime_error& err) { - std::cerr << err.what() << std::endl; - std::cerr << program; - std::exit(1); + std::cout << err.what() << std::endl; + std::cout << program; + std::exit(0); } auto files = program.get>("--input_files"); // {"config.yml", "System.xml"} @@ -360,9 +360,9 @@ try { program.parse_args(argc, argv); // Example: ./main --query_point 3.5 4.7 9.2 } catch (const std::runtime_error& err) { - std::cerr << err.what() << std::endl; - std::cerr << program; - std::exit(1); + std::cout << err.what() << std::endl; + std::cout << program; + std::exit(0); } auto query_point = program.get>("--query_point"); // {3.5, 4.7, 9.2} @@ -392,9 +392,9 @@ try { program.parse_args(argc, argv); // Example: ./main -abc 1.95 2.47 } catch (const std::runtime_error& err) { - std::cerr << err.what() << std::endl; - std::cerr << program; - std::exit(1); + std::cout << err.what() << std::endl; + std::cout << program; + std::exit(0); } auto a = program.get("-a"); // true @@ -497,9 +497,9 @@ try { program.parse_args(argc, argv); } catch (const std::runtime_error& err) { - std::cerr << err.what() << std::endl; - std::cerr << program; - std::exit(1); + std::cout << err.what() << std::endl; + std::cout << program; + std::exit(0); } try { @@ -544,9 +544,9 @@ try { program.parse_args(argc, argv); } catch (const std::runtime_error& err) { - std::cerr << err.what() << std::endl; - std::cerr << program; - std::exit(1); + std::cout << err.what() << std::endl; + std::cout << program; + std::exit(0); } auto output_filename = program.get("-o"); @@ -626,9 +626,9 @@ try { program.parse_args({"./test", "config.json"}); } catch (const std::runtime_error& err) { - std::cerr << err.what() << std::endl; - std::cerr << program; - std::exit(1); + std::cout << err.what() << std::endl; + std::cout << program; + std::exit(0); } nlohmann::json config = program.get("config"); @@ -662,9 +662,9 @@ try { program.parse_args(argc, argv); } catch (const std::runtime_error& err) { - std::cerr << err.what() << std::endl; - std::cerr << program; - std::exit(1); + std::cout << err.what() << std::endl; + std::cout << program; + std::exit(0); } auto numbers = program.get>("numbers"); // {1, 2, 3} @@ -704,9 +704,9 @@ try { program.parse_args(argc, argv); } catch (const std::runtime_error& err) { - std::cerr << err.what() << std::endl; - std::cerr << program; - std::exit(1); + std::cout << err.what() << std::endl; + std::cout << program; + std::exit(0); } auto input = program.get("input"); @@ -747,6 +747,25 @@ Thanks goes to these wonderful people: mupp
mupp
Ethan Slattery
Ethan Slattery
+ skrobinson
skrobinson
+ Mike Zozu
Mike Zozu
+ Chuvi-w
Chuvi-w
+ KOLANICH
KOLANICH
+ + + Rafał Będźkowski
Rafał Będźkowski
+ Yoshihiro Hokazono
Yoshihiro Hokazono
+ Kenny Shen
Kenny Shen
+ The 42nd Mu00
The 42nd Mu00
+ Daniel Marshall
Daniel Marshall
+ Ubpa
Ubpa
+ + + Oliver Smith
Oliver Smith
+ Joseph Durel
Joseph Durel
+ rysson
rysson
+ aashwinr
aashwinr
+ bufferbase
bufferbase