Open mmahmoudian opened 4 months ago
Wow thanks a lot! I love shell completions :-) Did you make it manually, or used some kind of automated tool?
Once this is merged, it's worth updating the package managers to automatically install these completions. For example for Homebrew, an additional statement to install completions should be added to the install
method. Examples of this from other tools:
I manually created those. I don't know of any automated way to generate them, and I don't think such software exist simply because there so many different styles of CLI:
app subcommand --arg=value
. For example:
git clone --depth=1
app --arg -a
For example:
pacman --sync -y
app -arg -arg
(which is my least favorite). For example:
micro -config-dir -deug
app subcommand --arg -- subcommand --arg -- subcommand
For example:
guix time-machine --channels="channel.scm" -- shell --pure --manifest="manifest.scm" -- myfunc --arg1
I have added shell completions for Bash, Zsh, and Nushell. I don't use Fish shell and on the first look it looked too complicated. Perhaps can be added in another PR.
This is a Draft PR because I don't know how in your build system these files should be integrated. On a typical linux distro bash should sit in
/usr/share/bash-completion/completions/
and should be renamed tomicro
, for zsh it should sit in/usr/share/zsh/site-functions
and should be renamed to_micro
.As for Nushell, the documentation is not clear about the path, so I think we should leave it as is, until a Nushell fan help us with that.