mirror of
https://github.com/reactos/ninja.git
synced 2024-11-23 11:49:45 +00:00
Support completion of arguments to -f and -C options
Note: This is only available for bash_completion users.
This commit is contained in:
parent
01ae9ac258
commit
4f9ac2aab9
@ -16,8 +16,25 @@
|
||||
# . path/to/ninja/misc/bash-completion
|
||||
|
||||
_ninja_target() {
|
||||
local cur targets dir line targets_command OPTIND
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
local cur prev targets dir line targets_command OPTIND
|
||||
|
||||
# When available, use bash_completion to:
|
||||
# 1) Complete words when the cursor is in the middle of the word
|
||||
# 2) Complete paths with files or directories, as appropriate
|
||||
if _get_comp_words_by_ref cur prev &>/dev/null ; then
|
||||
case $prev in
|
||||
-f)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-C)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
else
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
fi
|
||||
|
||||
if [[ "$cur" == "--"* ]]; then
|
||||
# there is currently only one argument that takes --
|
||||
|
Loading…
Reference in New Issue
Block a user