complete
Get and set argument autocompletion rules of shell commands in Bash. The specified completions will be invoked when
<Tab>is pressed in Bash. See also:compgen,compopt. More information: https://www.gnu.org/software/bash/manual/bash.html#index-complete.
- Set arguments of a command to autocomplete through a function (completion response is sent in
$COMPREPLYvariable):
complete -F
- Set arguments of a command to autocomplete through another command (
$1is the command,$2is the argument the cursor is on, and$3is the argument preceding the cursor):
complete -C
- Set arguments of a command to autocomplete to shell builtins:
complete -b
- Apply autocompletion without appending a space to the completed word:
complete -o nospace -F
- List all loaded complete specifications:
complete -p
- List loaded complete specifications for a command:
complete -p
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
