From e1a23246f2ecbd42faa203023afc291625ce7072 Mon Sep 17 00:00:00 2001 From: marcelarie Date: Tue, 15 Oct 2024 01:23:13 +0200 Subject: [PATCH] add todos --- README.md | 9 ++++++++- src/command/arguments.rs | 10 +++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a8311ef..cdb8835 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,16 @@ TODO: - [x] Write them to a file - [x] Single time - [ ] Use nushell env - - [x] Add no comments flag - [ ] Add a command to source the file + - [ ] Add debug flag + - [ ] Handle empty files - [ ] Handle multiple files in a directory + - [ ] Handle when no aliases are found in the file + - [ ] Handle when the file is not a bash script + - [x] Add help flag + - [x] Add no comments flag + - [x] Handle when file is `*.nu` + - [x] Handle when the file does not exist ## How? diff --git a/src/command/arguments.rs b/src/command/arguments.rs index aad7dfc..f7454a9 100644 --- a/src/command/arguments.rs +++ b/src/command/arguments.rs @@ -90,7 +90,7 @@ impl CliArgs { 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!("Usage: {} [options] ", program_name); println!(); println!("Options:"); println!(" -nc, --no-comments Do not include comments with the failed aliases in the output"); @@ -100,7 +100,9 @@ impl CliArgs { println!(" -h, --help Display this help message and exit"); println!(); println!("Arguments:"); - println!(" Path to the shell file to convert"); + println!( + " Path to the alias shell file to convert" + ); println!(); println!("Example:"); println!(" {} --no-comments ~/.bash_aliases", program_name); @@ -118,7 +120,9 @@ impl CliArgs { std::process::exit(0); } - let file_path = gathered.file_path.ok_or("No script name provided")?; + let file_path = gathered.file_path.ok_or( + "No file path provided.\nShow the help menu with -h or --help", + )?; Ok(Self { file_path,