Skip to content

Commit

Permalink
Return exit code 0 for --help
Browse files Browse the repository at this point in the history
Fixes #170.
  • Loading branch information
TheAssassin committed May 15, 2024
1 parent 0e7e8ce commit babb58d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ int main(const int argc, const char *const *const argv) {
args::ArgumentParser parser("linuxdeploy Qt plugin",
"Bundles Qt resources. For use with an existing AppDir, created by linuxdeploy.");

args::HelpFlag help(parser, "help", "Display this help text", {'h', "help"});

args::ValueFlag<fs::path> appDirPath(parser, "appdir path", "Path to an existing AppDir", {"appdir"});
args::ValueFlagList<std::string> extraPlugins(parser, "plugin",
"Extra Qt plugin to deploy (specified by name, filename or path)",
Expand All @@ -46,6 +48,9 @@ int main(const int argc, const char *const *const argv) {

try {
parser.ParseCLI(argc, argv);
} catch (const args::Help &) {
std::cerr << parser;
return 0;
} catch (const args::ParseError &) {
std::cerr << parser;
return 1;
Expand Down

0 comments on commit babb58d

Please sign in to comment.