Skip to content

Commit babb58d

Browse files
committed
Return exit code 0 for --help
Fixes #170.
1 parent 0e7e8ce commit babb58d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: src/main.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ int main(const int argc, const char *const *const argv) {
3434
args::ArgumentParser parser("linuxdeploy Qt plugin",
3535
"Bundles Qt resources. For use with an existing AppDir, created by linuxdeploy.");
3636

37+
args::HelpFlag help(parser, "help", "Display this help text", {'h', "help"});
38+
3739
args::ValueFlag<fs::path> appDirPath(parser, "appdir path", "Path to an existing AppDir", {"appdir"});
3840
args::ValueFlagList<std::string> extraPlugins(parser, "plugin",
3941
"Extra Qt plugin to deploy (specified by name, filename or path)",
@@ -46,6 +48,9 @@ int main(const int argc, const char *const *const argv) {
4648

4749
try {
4850
parser.ParseCLI(argc, argv);
51+
} catch (const args::Help &) {
52+
std::cerr << parser;
53+
return 0;
4954
} catch (const args::ParseError &) {
5055
std::cerr << parser;
5156
return 1;

0 commit comments

Comments
 (0)