Re: complete NAME seems to diasable completion for NAME in the case of git
On 12/21/23 5:26 PM, Martin D Kealey wrote: The problem is, there's a documentation error. "help complete" says "if no options are supplied…" when it should say something more like "if the -p option is given, or if no arguments are given…" This is the right answer. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/ OpenPGP_signature.asc Description: OpenPGP digital signature
Re: complete NAME seems to diasable completion for NAME in the case of git
On Fri, 22 Dec 2023, 05:55 Andreas Schwab, wrote: > If you want to print existing completions, use > complete -p [NAME...]. > The problem is, there's a documentation error. "help complete" says "if no options are supplied…" when it should say something more like "if the -p option is given, or if no arguments are given…" -Martin >
Re: complete NAME seems to diasable completion for NAME in the case of git
On Dez 21 2023, Britton Kerin wrote: > But if I do `complete git' at a new shell That overwrites the completion spec for git (with the empty set, ie. no completions at all). If you want to print existing completions, use complete -p [NAME...]. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."
complete NAME seems to diasable completion for NAME in the case of git
help complete shows: $ help complete 5001 complete: complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...] Specify how arguments are to be completed by Readline. For each NAME, specify how arguments are to be completed. If no options are supplied, existing completion specifications are printed in a way that allows them to be reused as input. But if I do `complete git' at a new shell, then completion for git subcommands seems to stop working. So it seems that at least in this case the help is ending up wrong (it changes things rather than just interrogating). I found this in the course of trying to find how git is demand-loading it's completion setup. I didn't even find an entry point loaded at source-time in https://github.com/git/git/blob/master/contrib/completion/git-completion.bash and none of the functions in there are loaded until completion of a git subcommand has been attempted. so I suspect the above behavior is related to how demand-loading is accomplished for git (which I have no idea about yet). Britton