]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - shell-completion/bash/coredumpctl
shell-completion: replace "gdb" verb with "debug" for coredumpctl
[thirdparty/systemd.git] / shell-completion / bash / coredumpctl
index 87fe473e091905db48a032a269eed1af0fbdaf6f..f73fd272f584efa4880448e308cfb00513eb54ef 100644 (file)
@@ -1,8 +1,9 @@
 # coredumpctl(1) completion                       -*- shell-script -*-
+# SPDX-License-Identifier: LGPL-2.1+
 #
 # This file is part of systemd.
 #
-# Copyright 2010 Ran Benita
+# Copyright © 2010 Ran Benita
 #
 # systemd is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as published by
@@ -38,22 +39,29 @@ _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 --debugger'
 
         local -A VERBS=(
-            [LIST]='list'
-            [DUMP]='dump gdb'
+            [LIST]='list info'
+            [DUMP]='dump debug'
         )
 
         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" '--debugger'; then
+                comps=$( compgen -A command -- "$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 --debugger'; then
                 compopt -o nospace
                 COMPREPLY=( $(compgen -W '${__journal_fields[*]}' -S= -- "$cur") )
                return 0