From c0d7f5f5df079e3546a8203416bac41dc573cbaf Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 31 Oct 2023 20:12:38 +0800 Subject: [PATCH] fix a bug in a fail state when using an invalid subcommand --- src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 38c96f5..93fdad0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -104,7 +104,10 @@ pub fn rox() -> RoxResult<()> { let task_name = args.subcommand_name().unwrap().to_owned(); vec![execute_tasks(vec![task_name], &task_map, false)] } - &_ => std::process::abort(), + command => { + println!("'{}' is not a valid subcommand!", command); + std::process::exit(2); + } }; output::display_execution_results(results.clone()); println!(