Open Strongleong opened 2 years ago
Are you sure, cod
learned completions? I have following doubts:
cod
doesn't support shell aliases (what kind of alias did you create?)cod
doesn't learn -h
flag by default, it learns only full --help
flag (or did you invoke cod learn
explicitly)?You can try cod list
. Does it show your command config -h
?
1) My alias: alias config='/usr/bin/git --git-dir=$HOME/dotfiles/ --work-tree=$HOME'
2) I typed config --help
, sorry for my mistake in original post :sweat_smile:
3) My cod list
:
~ > cod list
2 /usr/bin/fd --help
3 /usr/bin/git '--git-dir=$HOME/dotfiles/' '--work-tree=$HOME' --help
5 /usr/local/bin/phpactor --help
1 /usr/bin/pip --help
Cod definitely detected help page for my alias, it can autocomplete all of git commands and flags. But do not autocomplete files(
Are you using bash
shell? Can you please show me output of complete
command? (It shows how completion is configured for all of your commands).
I am using zsh
shell.
Nor complete
, nor cod complete
don't wokrs
zsh stores functions used in completions in _comps
map. Could you please provide output of such command
for key value in ${(kv)_comps}; do echo "$key -> $value" ; done
Output of this command is to long, I post it on pastebin
https://pastebin.com/zjuXtrWK
git -> _git
So your git command is completed using built in _git
function (that's not surprising, zsh
has a lot of completions by default). When cod
takeovers completion of the command, entries in _comp
Example from my machine:
ipython3 -> __cod_complete_zsh
logrep -> __cod_complete_zsh
cod -> __cod_complete_zsh
So we have 2 questions:
_git
completion doesn't complete filenames (and I'm afraid I'm not an expert here).cod
didn't takeover git completion. I'll take a look at that.
Can't really come up with good title, sorry. Bad English knowledge.
So, I made bare git repository for my dot files and make alias
config
for this repo. Afterconfig -h
cod picked up possible flags and commands as expected. But when I try type something likeconfig add ~/.config/
and pressTAB
nothing happens.