We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 77d8abd commit fa5f639Copy full SHA for fa5f639
main.cpp
@@ -1719,6 +1719,14 @@ int parse(const int argc, char **argv) {
1719
};
1720
1721
auto args = cli::make_args(argc, argv);
1722
+
1723
+ // Check if any -h or --help argument was requested, if so insert the help subcommand before any
1724
+ // arguments, this will ensure the correct help gets printed automatically.
1725
+ bool help_requested = std::find(args.begin(), args.end(), "--help") != args.end()
1726
+ || std::find(args.begin(), args.end(), "-h") != args.end();
1727
+ if (help_requested) {
1728
+ args.insert(args.begin(), "help");
1729
+ }
1730
if (args.empty()) {
1731
usage();
1732
return 0;
0 commit comments