Skip to content

Commit

Permalink
bmpflash: The help and version options no longer need the explicit ei…
Browse files Browse the repository at this point in the history
…ther-or check
  • Loading branch information
dragonmux committed Oct 14, 2024
1 parent c7106af commit ea1fa34
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/bmpflash.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,7 @@ int main(const int argCount, const char *const *const argList)
console.showDebug(verbosity & 1U);

// Handle the version and help options first
const auto *const version{args["version"sv]};
const auto *const help{args["help"sv]};
if (version && help)
{
console.error("Can only specify one of --help and --version, not both."sv);
return 1;
}
if (version)
if (args["version"sv])
{
bmpflash::displayVersion();
const auto *const libusbVersion{libusb_get_version()};
Expand All @@ -76,7 +69,7 @@ int main(const int argCount, const char *const *const argList)
return 0;
}
// Display the help if requested or there were no command line options given
if (help || args.count() == 0U)
if (args["help"sv] || args.count() == 0U)
{
bmpflash::programOptions.displayHelp(args);

Check warning on line 74 in src/bmpflash.cxx

View check run for this annotation

Codecov / codecov/patch

src/bmpflash.cxx#L74

Added line #L74 was not covered by tests
return 0;
Expand Down

0 comments on commit ea1fa34

Please sign in to comment.