Skip to content

Commit

Permalink
do not proceed if -h/--help passed on the command line
Browse files Browse the repository at this point in the history
  • Loading branch information
whoozle committed Nov 11, 2023
1 parent 56c8d84 commit 6e9ac2d
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions fuse/fuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,6 @@ int main(int argc, char **argv)
std::string deviceFilter;
bool claimInterface = true;
bool resetDevice = false;
bool showHelp = false;

std::vector<char *> args;
args.push_back(argv[0]);
Expand Down Expand Up @@ -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 <name> filter by manufacturer/model/serial");
mtp::print(" -v AFT verbose output");
return 0;
} else
args.push_back(argv[i]);
}
Expand Down Expand Up @@ -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 <name> filter by manufacturer/model/serial");
mtp::print(" -v AFT verbose output");
}
fuse_opt_free_args(&fuse_args);

return err ? 1 : 0;
Expand Down

0 comments on commit 6e9ac2d

Please sign in to comment.