[systemd-commits] 2 commits - shell-completion/systemd-bash-completion.sh src/journal

Dave Reisner dreisner at kemper.freedesktop.org
Fri Nov 9 12:31:09 PST 2012


 shell-completion/systemd-bash-completion.sh |    7 +++++--
 src/journal/coredumpctl.c                   |    1 +
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit ef216ca3d7ddc00c629fbbc37dd1e7f98f9e9220
Author: Dave Reisner <dreisner at archlinux.org>
Date:   Fri Nov 9 14:14:53 2012 -0500

    coredumpctl: add missing -F, --field option to help

diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
index 663e3cd..bdea8ed 100644
--- a/src/journal/coredumpctl.c
+++ b/src/journal/coredumpctl.c
@@ -87,6 +87,7 @@ static int help(void) {
                "Commands:\n"
                "  -h --help         Show this help\n"
                "  --version         Print version string\n"
+               "  -F --field=FIELD  List all values a certain field takes\n"
                "  gdb               Start gdb for the first matching coredump\n"
                "  list              List available coredumps\n"
                "  dump PID          Print coredump to stdout\n"

commit 253a87510b2e09ad2679824b7255dab0a6bb1a22
Author: Dave Reisner <dreisner at archlinux.org>
Date:   Fri Nov 9 12:51:24 2012 -0500

    bash-completion: add 'gdb' verb for coredumpctl
    
    This also fixes value completion for journal fields, as the completion
    for the RHS of the '=' was missing when it was borrowed from journalctl.

diff --git a/shell-completion/systemd-bash-completion.sh b/shell-completion/systemd-bash-completion.sh
index 5f829b3..4c8161f 100644
--- a/shell-completion/systemd-bash-completion.sh
+++ b/shell-completion/systemd-bash-completion.sh
@@ -281,7 +281,7 @@ _loginctl () {
 complete -F _loginctl loginctl
 
 __journal_fields=(MESSAGE{,_ID} PRIORITY CODE_{FILE,LINE,FUNC}
-                  ERRNO SYSLOG_{FACILITY,IDENTIFIER,PID}
+                  ERRNO SYSLOG_{FACILITY,IDENTIFIER,PID} COREDUMP_EXE
                   _{P,U,G}ID _COMM _EXE _CMDLINE
                   _AUDIT_{SESSION,LOGINUID}
                   _SYSTEMD_{CGROUP,SESSION,UNIT,OWNER_UID}
@@ -349,7 +349,7 @@ _coredumpctl() {
 
         local -A VERBS=(
             [LIST]='list'
-            [DUMP]='dump'
+            [DUMP]='dump gdb'
         )
 
         if __contains_word "$prev" '--output -o'; then
@@ -368,6 +368,9 @@ _coredumpctl() {
                 mapfile -t field_vals < <(systemd-coredumpctl -F "${prev%=}" 2>/dev/null)
                 COMPREPLY=( $(compgen -W '${field_vals[*]}' -- "${cur#=}") )
                 return 0
+        elif [[ $prev = '=' ]]; then
+                mapfile -t field_vals < <(systemd-coredumpctl -F "${COMP_WORDS[COMP_CWORD-2]}" 2>/dev/null)
+                comps=${field_vals[*]}
         else
                 for ((i=0; i <= COMP_CWORD; i++)); do
                         if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]}; then



More information about the systemd-commits mailing list