Skip to content

Commit daf417b

Browse files
authored
return exit code 0 when no args are provided (#53)
1 parent 345c831 commit daf417b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::job::event::{RestartBehavior, RestartStrategy};
1010
)]
1111
pub struct Cli {
1212
#[command(subcommand)]
13-
pub command: Commands,
13+
pub command: Option<Commands>,
1414

1515
#[arg(long, short, help = "Print extra information")]
1616
pub verbose: bool,

src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,12 @@ async fn main() -> Result<()> {
128128
colored::control::set_override(false);
129129
}
130130

131-
match args.command {
131+
let Some(command) = args.command else {
132+
let _ = <args::Cli as clap::CommandFactory>::command().print_help();
133+
std::process::exit(0);
134+
};
135+
136+
match command {
132137
args::Commands::List {
133138
all,
134139
group,

0 commit comments

Comments
 (0)