diff --git a/src/command/arguments.rs b/src/command/arguments.rs index bcf80f0..aad7dfc 100644 --- a/src/command/arguments.rs +++ b/src/command/arguments.rs @@ -26,6 +26,14 @@ impl CliArgs { while let Some(arg) = args.next() { if !arg.starts_with('-') && script_name.is_none() { + if arg.ends_with(".nu") { + println!("Invalid script name: {}", arg.to_string()); + println!( + "The input should be a bash aliases script (typically with no extension), not a Nushell script (.nu)" + ); + std::process::exit(1); + } + script_name = Some(arg); // TODO: Check if this should be continue or break continue; @@ -75,17 +83,27 @@ impl CliArgs { } fn print_help() { + let program_name = std::env::args() + .next() + .unwrap_or_else(|| "nu-alias-converter".to_string()); + + println!("Nu Alias Converter"); + println!("A tool that converts bash aliases to nushell without breaking your nu config."); + println!(); + println!("Usage: {} [options] ", program_name); + println!(); + println!("Options:"); + println!(" -nc, --no-comments Do not include comments with the failed aliases in the output"); println!( - "Usage: {} [options]