Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelarie committed Oct 15, 2024
1 parent 24fcba0 commit 89a3ac3
Showing 1 changed file with 31 additions and 23 deletions.
54 changes: 31 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,6 @@
> [!NOTE]
> This project is for educational purposes. I aim to learn more about tree-sitter and Rust.
TODO:

- [ ] Bash aliases converter (bash to nushell)
- [x] Use treesitter to parse bash and get all the aliases
- [ ] Handle `expand_aliases` and `shopt -s expand_aliases`
- [ ] Needs to be recursive
- [x] Convert them to nushell format
- [x] Validate the content of the alias to check if it is valid nushell
- [x] Write them to a file
- [x] Single time
- [ ] Use nushell env
- [ ] 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
- [ ] Add `.alias_ignore` file to ignore aliases on conversion

## How?

The CLI app will be written in Rust, needs to be to use the nushell crates
Expand Down Expand Up @@ -80,3 +57,34 @@ in the future it will work like this:
```bash
nu-alias-converter .bash_aliases --out /path/to/nushell/nushell_aliases.nu
```

**TODO:**

**Parsing Bash Aliases**
- [x] Use tree-sitter to parse Bash and get all aliases
- [ ] Handle `expand_aliases` and `shopt -s expand_aliases`
- [ ] Implement recursive handling

**Conversion to Nushell Format**
- [x] Convert aliases to Nushell format
- [x] Validate alias content to ensure it is valid Nushell (with nu-parser)

**File Handling**
- [x] Write the converted aliases to a file
- [x] Write once
- [ ] Use Nushell environment variables
- [ ] Add a command to source the file in Nushell
- [ ] Implement auto-source functionality (?)
- [ ] Handle empty files
- [ ] Handle multiple files in a directory
- [ ] Handle cases when no aliases are found in the file
- [ ] Handle non-Bash script files
- [ ] Add `.alias_ignore` file to skip certain aliases during conversion

**Flags and Modes**
- [x] Add `--help` flag
- [x] Add `--no-comments` flag
- [x] Handle `*.nu` files error
- [x] Handle missing files
- [x] Add debug mode

0 comments on commit 89a3ac3

Please sign in to comment.