diff --git a/src/platform/climain.cpp b/src/platform/climain.cpp index 0f0c6b27..f41e2423 100644 --- a/src/platform/climain.cpp +++ b/src/platform/climain.cpp @@ -10,8 +10,8 @@ namespace SolveSpace { extern std::shared_ptr framebuffer; } -static void ShowUsage(const std::string &argv0) { - fprintf(stderr, "Usage: %s [filename...]", argv0.c_str()); +static void ShowUsage(const std::string &cmd) { + fprintf(stderr, "Usage: %s [filename...]", cmd.c_str()); //-----------------------------------------------------------------------------> 80 col */ fprintf(stderr, R"( When run, performs an action specified by on every . @@ -84,6 +84,13 @@ static void ShowUsage(const std::string &argv0) { static bool RunCommand(const std::vector args) { if(args.size() < 2) return false; + for(const std::string &arg : args) { + if(arg == "--help" || arg == "-h") { + ShowUsage(args[0]); + return true; + } + } + std::function runner; std::vector inputFiles;