From 6e9ac2dfa32a962e89c28999633ee3c7f8b5c4af Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 11 Nov 2023 21:45:49 +0000 Subject: [PATCH] do not proceed if -h/--help passed on the command line --- fuse/fuse.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/fuse/fuse.cpp b/fuse/fuse.cpp index 1be19289..27af98df 100644 --- a/fuse/fuse.cpp +++ b/fuse/fuse.cpp @@ -874,7 +874,6 @@ int main(int argc, char **argv) std::string deviceFilter; bool claimInterface = true; bool resetDevice = false; - bool showHelp = false; std::vector args; args.push_back(argv[0]); @@ -912,8 +911,14 @@ int main(int argc, char **argv) } else if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) { - args.push_back(argv[i]); - showHelp = true; + mtp::print(); + mtp::print("Additional AFT options: "); + mtp::print(" -R reset device"); + mtp::print(" -C do not claim USB interface"); + mtp::print(" -d / -o debug show MTP debug output"); + mtp::print(" -D filter by manufacturer/model/serial"); + mtp::print(" -v AFT verbose output"); + return 0; } else args.push_back(argv[i]); } @@ -980,14 +985,6 @@ int main(int argc, char **argv) } else { mtp::error("fuse_parse_cmdline failed"); } - if (showHelp) { - mtp::print(); - mtp::print("Additional AFT options: "); - mtp::print(" -R reset device"); - mtp::print(" -C do not claim USB interface"); - mtp::print(" -D filter by manufacturer/model/serial"); - mtp::print(" -v AFT verbose output"); - } fuse_opt_free_args(&fuse_args); return err ? 1 : 0;