2018-02-27 03:21:46 +00:00
|
|
|
logmsg Completion Wrappers
|
|
|
|
|
2018-02-27 22:06:39 +00:00
|
|
|
function complete_test_alpha1; echo $argv; end
|
|
|
|
|
2018-02-27 03:21:46 +00:00
|
|
|
complete -c complete_test_alpha1 --no-files -a '(commandline)'
|
|
|
|
complete -c complete_test_alpha2 --no-files -w 'complete_test_alpha1 extra1'
|
|
|
|
complete -c complete_test_alpha3 --no-files -w 'complete_test_alpha2 extra2'
|
|
|
|
|
|
|
|
complete -C'complete_test_alpha1 arg1 '
|
|
|
|
complete -C'complete_test_alpha2 arg2 '
|
|
|
|
complete -C'complete_test_alpha3 arg3 '
|
2019-04-26 12:54:51 +00:00
|
|
|
# Works even with the argument as a separate token.
|
|
|
|
complete -C 'complete_test_alpha3 arg3 '
|
2018-02-27 22:06:39 +00:00
|
|
|
|
|
|
|
logmsg Alias Completions
|
|
|
|
|
|
|
|
alias myalias1 'complete_test_alpha1 arg1'
|
|
|
|
alias myalias2='complete_test_alpha1 arg2'
|
|
|
|
|
|
|
|
myalias1 call1
|
|
|
|
myalias2 call2
|
|
|
|
complete -C'myalias1 call3 '
|
2019-01-17 15:43:24 +00:00
|
|
|
complete -C'myalias2 call3 '
|
|
|
|
|
|
|
|
# Ensure that commands can't wrap themselves - if this did,
|
|
|
|
# the completion would be executed a bunch of times.
|
|
|
|
function t --wraps t; echo t; end
|
|
|
|
complete -c t -fa '(t)'
|
|
|
|
complete -C't '
|