diff options
author | Gabriel F. T. Gomes <gabriel@inconstante.eti.br> | 2018-03-18 12:02:11 -0300 |
---|---|---|
committer | Gabriel F. T. Gomes <gabriel@inconstante.eti.br> | 2018-03-18 12:02:11 -0300 |
commit | 9cd22d1df8f0f5b554858471c86faa9f37b8fed4 (patch) | |
tree | 6399b936aecc388506ec32cfc10fdb06cfc1949f /completions/xdg-settings | |
parent | 6d88f1055806932d9291f96847d2b691cccda2cd (diff) | |
download | bash-completion-9cd22d1df8f0f5b554858471c86faa9f37b8fed4.tar.gz |
New upstream version 2.8upstream/2.8
Diffstat (limited to 'completions/xdg-settings')
-rw-r--r-- | completions/xdg-settings | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/completions/xdg-settings b/completions/xdg-settings new file mode 100644 index 00000000..15f040d4 --- /dev/null +++ b/completions/xdg-settings @@ -0,0 +1,29 @@ +# xdg-settings completion -*- shell-script -*- + +_xdg_settings() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help|--list|--manual|--version) + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( "$1" --help | + command sed -e "s/[{|]/\n/g" | _parse_help - )' -- "$cur" ) ) + return + fi + + local args + _count_args + if [[ $args -eq 1 ]]; then + COMPREPLY=( $( compgen -W "get check set" -- "$cur" ) ) + elif [[ $args -eq 2 ]]; then + COMPREPLY=( $( compgen -W \ + '$( "$1" --list | awk "!/^Known/ { print \$1 }" )' -- "$cur" ) ) + fi +} && +complete -F _xdg_settings xdg-settings |