#Bash 的 compopt 命令
compopt [OPTION]... [NAME]...
功能
修改或显示补全选项。
类型
Bash 内置命令。
参数
OPTION- 选项:-o option- 开启选项nospace- 补全后不自动添加空格filenames- 告知 Bash 结果是文件名;补全过程中会在目录后加上/bashdefault- 如果没找到匹配项,则回退到 Bash 默认补全default- 如果没找到匹配项,则回退到默认行为dirnames- 如果没有匹配项,则尝试进行目录名补全
+o option- 关闭选项-D- 修改默认的补全方式;通常是文件-E- 修改命令行为空时的补全方式;通常是命令-I- 修改开始词的补全方式;通常是命令
NAME- 要修改补全选项的名称;如果没有此参数,则修改正在执行的补全选项
#相关命令
#手册
compopt: compopt [-o|+o option] [-DEI] [name ...]
Modify or display completion options.
Modify the completion options for each NAME, or, if no NAMEs are supplied,
the completion currently being executed. If no OPTIONs are given, print
the completion options for each NAME or the current completion specification.
Options:
-o option Set completion option OPTION for each NAME
-D Change options for the "default" command completion
-E Change options for the "empty" command completion
-I Change options for completion on the initial word
Using `+o' instead of `-o' turns off the specified option.
Arguments:
Each NAME refers to a command for which a completion specification must
have previously been defined using the `complete' builtin. If no NAMEs
are supplied, compopt must be called by a function currently generating
completions, and the options for that currently-executing completion
generator are modified.
Exit Status:
Returns success unless an invalid option is supplied or NAME does not
have a completion specification defined.