Skip to content

Commit

Permalink
small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-matsui committed Jan 27, 2025
1 parent 159f18e commit 8faa6c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Cabin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static std::string
colorizeAnyhowError(std::string s) {
if (s.find("Caused by:") != std::string::npos) {
replaceAll(s, "Caused by:", Yellow("Caused by:").toErrStr());
// `Caused by:` leaves a trailing newline, TODO: upstream this
// `Caused by:` leaves a trailing newline, FIXME: upstream this
replaceAll(s, "\n", "");
}
return s;
Expand Down
5 changes: 1 addition & 4 deletions src/Cli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,6 @@ Cli::expandOpts(const std::span<const char* const> args) const noexcept {
}
return shortOpts;
};
const auto isRunSubcmd = [](const Subcmd& subcmd) {
return subcmd.name == "run";
};

std::optional<std::reference_wrapper<const Subcmd>> curSubcmd;
std::reference_wrapper<const Opts> curLocalOpts = localOpts;
Expand Down Expand Up @@ -596,7 +593,7 @@ Cli::expandOpts(const std::span<const char* const> args) const noexcept {
}

// Unknown argument case
if (isRunSubcmd(curSubcmd->get())) {
if (curSubcmd->get().name == "run") {
// The "run" subcommand assumes that arguments from the first unknown
// argument are passed to the program to be executed. So, we should
// stop expanding options from now on.
Expand Down

0 comments on commit 8faa6c9

Please sign in to comment.