Consider functions instead of alias #779
Labels
bash
CLI
IDEasy command-line-interface (parsing args, etc.)
completion
auto-completion in bash or build in CLI
enhancement
New feature or request
Milestone
In IDEasy we currently define
ide
as an alias to sourcing a script.For auto-completion we also hook in via a sourced bash script (
source $IDE_ROOT/_ide/completion
).With #778 a new such command is to be added that also needs autocompletion.
An alternative could be to use bash functions instead:
ide
script in$IDE_ROOT/_ide/bin
we can have$IDE_ROOT/functions
.source $IDE_ROOT/functions
to.bashrc
/.zshrc
.functions
we can also check if we are inzsh
and install autocompletion to simplify setup and uninstallation of IDEasy if all we need might be a single line of code in.bashrc
/.zshrc
.functions
"script" that is sourced can define bash functions such aside
andicd
instead that we usealias
for that.IMHO this will simplify and increase flexibility for future extension (e.g. if we have more ideas like #778), since we only need to tweak
.bashrc
once and forever and newer releases of IDEasy can add new commands and completions all viafunctions
.The first step with this story should be an analysis and PoC testing if this plan works well or there are some drawbacks of this idea.
If all works as planned, we should implement it this way since it seems the superior design.
The text was updated successfully, but these errors were encountered: