]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bash-completion: coredumpctl: support more options
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 10 Jan 2018 14:15:21 +0000 (23:15 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 10 Jan 2018 14:15:21 +0000 (23:15 +0900)
shell-completion/bash/coredumpctl

index 842e4943ff3b3f010ce47f9274dd9395982bc347..bc069a76447b4c5972719bc82685abc7fea41bed 100644 (file)
@@ -39,22 +39,25 @@ _coredumpctl() {
         local i verb comps
         local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
         local OPTS='-h --help --version --no-pager --no-legend -o --output -F --field -1
-                    -r --reverse -S --since -U --until'
+                    -r --reverse -S --since -U --until -D --directory -q --quiet'
 
         local -A VERBS=(
-            [LIST]='list'
+            [LIST]='list info'
             [DUMP]='dump gdb'
         )
 
         if __contains_word "$prev" '--output -o'; then
                 comps=$( compgen -A file -- "$cur" )
                 compopt -o filenames
-        elif __contains_word "$prev" '--FIELD -F'; then
+        elif __contains_word "$prev" '-D --directory'; then
+                comps=$( compgen -A directory -- "$cur" )
+                compopt -o filenames
+        elif __contains_word "$prev" '--field -F'; then
                 comps=$( compgen -W '${__journal_fields[*]}' -- "$cur" )
         elif [[ $cur = -* ]]; then
                 comps=${OPTS}
         elif __contains_word "$prev" ${VERBS[*]} &&
-           ! __contains_word ${COMP_WORDS[COMP_CWORD-2]} '--output -o -F --field'; then
+           ! __contains_word ${COMP_WORDS[COMP_CWORD-2]} '--output -o -D --directory -F --field'; then
                 compopt -o nospace
                 COMPREPLY=( $(compgen -W '${__journal_fields[*]}' -S= -- "$cur") )
                return 0