Sample Header Ad - 728x90

Is it normal for "complete -p git" to error until I autocomplete git first?

5 votes
1 answer
70 views
If I restart my terminal, I get an error when I type this:
$ complete -p git
bash: complete: git: no completion specification
But if I type git tab then run the complete command again, I get a different output:
$ complete -p git
complete -o bashdefault -o default -o nospace -F __git_wrap__git_main git
Once the shell becomes interactive, should complete -p git succeed on the first try, or is this working as designed? --- For context, I'd like to call the __git_complete function in my .bashrc/.bash_profile to add autocompletion to my custom command , but it doesn't seem to exist until I autocomplete git first. Also, I'm using cygwin on a Windows 10 machine, but I'm more interested in knowing how complete -p git works on other unix's.
Asked by Daniel Kaplan (1070 rep)
Jul 14, 2024, 11:39 PM
Last activity: Jul 15, 2024, 05:40 PM