v0.2.0
Features
Support Recursive Aliases
Expands all aliases to find the matching alias even if the best-fitting alias uses a different alias in its definition.
For example:
alias gb='git branch'
alias gba='gb --all'In v0.1.0, inputting git branch --all would result in gb='git branch'. Starting from v0.2.0, the program can detect that gb is an alias and "expand" it to become git branch, resulting in the output being gba='git branch --all'.
Basically, the aliases we input are converted into their full commands:
alias gb='git branch'
alias gba='git branch --all'If you input gb --all, the output would also be gba='git branch --all', since the definition of the gba alias is exactly that, but what's more interesting is if we add another alias: alias g='git' and input the command g branch --all, we would also get gba='git branch --all'. This is because the expansions happens not only for the inputted aliases, but also for the command itself, which becomes git branch --all.
Bug Fixes
- Fixed bug where an alias of a command with no arguments (for example
alias g='git') could never match
Infrastructure
- Refactored the code to parse once, optimising performance and safety
- Exported more functions and structs in the API
- Added more unit tests