-
Notifications
You must be signed in to change notification settings - Fork 401
Closed
Description
Describe the bug
When a command is completed with complete -C, sudo complete is not working.
To reproduce
$ complete -C 'echo' foo
$ sudo foo <tab>
Gives warning:
-bash: compgen: warning: -C option may not work as you expect
Expected behavior
No warning message thrown, and sudo foo completes the same way as foo.
Versions (please complete the following information)
- [linux] Operating system name/distribution and version:
- [5.1] bash version,
echo "$BASH_VERSION": - [2.11] bash-completion version,
(IFS=.; echo "${BASH_COMPLETION_VERSINFO[*]}"):
Additional context
man bash says about compgen:
When using the -F or -C options, the various shell variables set by the programmable completion facilities, while available, will not have useful values.
_command_offset knows about -F but not -C:
...
if [[ ${cspec#* -F } != "$cspec" ]]; then
...
Debug trace
Metadata
Metadata
Assignees
Labels
No labels