Skip to content

Commit

Permalink
Cli: fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-matsui committed Jan 27, 2025
1 parent 66d0c39 commit 159f18e
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Cli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -596,11 +596,6 @@ Cli::expandOpts(const std::span<const char* const> args) const noexcept {
}

// Unknown argument case
if (!curSubcmd.has_value()) {
// No matches on the top level, so it's an error.
return noSuchArg(arg);
}

if (isRunSubcmd(curSubcmd->get())) {
// The "run" subcommand assumes that arguments from the first unknown
// argument are passed to the program to be executed. So, we should
Expand All @@ -611,9 +606,7 @@ Cli::expandOpts(const std::span<const char* const> args) const noexcept {
}
break;
}

// No matches on the subcommand, so it's an error.
return curSubcmd->get().noSuchArg(arg);
expanded.emplace_back(arg);
}
return Ok(expanded);
}
Expand Down

0 comments on commit 159f18e

Please sign in to comment.