bmpflash: The help and version options no longer need the explicit either-or check

This commit is contained in:
dragonmux
2024-01-07 21:35:55 +00:00
parent c7106af9b7
commit ea1fa3450f

View File

@@ -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()};
@@ -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);
return 0;