croc
croc copied to clipboard
[Shell Completion] Avoid setting ${PROG} by replacing "$PROG" with "croc"
What and How
From #253, #282 and croc Installer Script, it seems that to have zsh completion, the user needs to add these to their .zshrc
.
-
PROG=croc
-
CLI_ZSH_AUTOCOMPLETE_HACK=1
-
source /whatever/path/to/zsh/zsh_autocomplete_croc
However, the first can be avoided by replacing $PROG
with croc
in zsh_autocomplete
.
Why
- One less shell variable in the environment
- Avoid conflicts when multiple programs use the autocomplete from urfave/cli (read:
croc
and let's say,brob
both wish to set$PROG
, so one loses its shell completion) - Why not? Is there any particular reason not to do that 😃?
Additional context
By the way, would you mind adding documentation about shell completion? Neither README.md nor your blog ever mention it at all. I came to know that only by checking installer script (and later, archived binary in release page) 😦.
Happy to accept PRs for any of these things (updating documentation, or changing the zsh_autocomplete_croc file to avoid PROG).
Stale issue message