bin: Handle --no-forward wo/ command correctly

This commit is contained in:
Erik Kundt
2025-01-27 16:47:12 +01:00
parent 8d693a6a64
commit 4b05911faf
+13 -7
View File
@@ -100,23 +100,29 @@ fn parse_args() -> anyhow::Result<Command> {
let command = match command {
Some(CommandName::Help) => {
if forward {
Some(Command::Other(vec!["help".into()]))
Command::Other(vec!["help".into()])
} else {
Some(Command::Help)
Command::Help
}
}
Some(CommandName::Version) => {
if forward {
Some(Command::Other(vec!["version".into()]))
Command::Other(vec!["version".into()])
} else {
Some(Command::Version { json })
Command::Version { json }
}
}
Some(CommandName::Other(args)) => Command::Other(args),
_ => {
if forward {
Command::Other(vec!["help".into()])
} else {
Command::Other(vec![])
}
}
Some(CommandName::Other(args)) => Some(Command::Other(args)),
_ => None,
};
Ok(command.unwrap_or_else(|| Command::Other(vec![])))
Ok(command)
}
fn print_help() -> anyhow::Result<()> {