Skip to content

Commit

Permalink
add todos
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelarie committed Oct 14, 2024
1 parent 3496a1c commit e1a2324
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down
10 changes: 7 additions & 3 deletions src/command/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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] <bash_aliases>", program_name);
println!("Usage: {} [options] <bash-aliases-script>", program_name);
println!();
println!("Options:");
println!(" -nc, --no-comments Do not include comments with the failed aliases in the output");
Expand All @@ -100,7 +100,9 @@ impl CliArgs {
println!(" -h, --help Display this help message and exit");
println!();
println!("Arguments:");
println!(" <bash_aliases> Path to the shell file to convert");
println!(
" <file_path> Path to the alias shell file to convert"
);
println!();
println!("Example:");
println!(" {} --no-comments ~/.bash_aliases", program_name);
Expand All @@ -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,
Expand Down

0 comments on commit e1a2324

Please sign in to comment.