[pve-devel] [PATCH proxmox-firewall 2/2] firewall: add subcommands to proxmox-firewall binary
Gabriel Goller
g.goller at proxmox.com
Wed Apr 23 13:46:16 CEST 2025
On 14.04.2025 17:44, Stefan Hanreich wrote:
> [snip]
>+fn main() -> Result<(), Error> {
>+ let mut args = Arguments::from_env();
>+
>+ let parsed_command = args.subcommand()?
>+ .ok_or_else(|| format_err!("no subcommand specified"))?
Maybe we could print HELP here again? So that you don't have to guess
the subcommands.
>+ .parse();
>+
>+ if let Ok(command) = parsed_command {
>+ run_command(command)
>+ } else {
>+ eprintln!("Invalid command specified!\n{}", HELP);
>+ std::process::exit(1);
>+ }
>+
>+}
Also this file needs a `cargo fmt` :)
Otherwise the whole series looks good, consider:
Reviewed-by: Gabriel Goller <g.goller at proxmox.com>
Tested-by: Gabriel Goller <g.goller at proxmox.com>
More information about the pve-devel
mailing list