Bash completion for path in argument (with equals sign present)

前端 未结 3 1317
醉酒成梦
醉酒成梦 2021-01-05 05:53

I used to be able to type the following:

$> ./foo --arg=

Where foo is any program I wrote, and it would give me a list of files in the current dir

3条回答
  •  渐次进展
    2021-01-05 06:33

    Not sure what environment you're in, but on a recent CentOS

    complete -D -o default
    

    enables filename completion after a token w/o whitespace as the default. To toggle it in the other direction:

    complete -D -o nospace
    

    However, it looks like older versions of the builtin don't have the -D option.

提交回复
热议问题