]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
zsh/coredumpctl: Never sort the completion candidates 7872/head
authorWieland Hoffmann <themineo@gmail.com>
Sat, 13 Jan 2018 14:23:28 +0000 (15:23 +0100)
committerWieland Hoffmann <themineo@gmail.com>
Sat, 13 Jan 2018 14:23:28 +0000 (15:23 +0100)
That way, they're always sorted by date. I do not know how to make ZSH sort
them by PID through some option, but that doesn't seem very useful in the first
place.

shell-completion/zsh/_coredumpctl

index 3445aa6f3d9684264aa06881c69ed2851cb9e603..f727820660a481e070c7519ff423a6c7e3c31096 100644 (file)
@@ -16,10 +16,9 @@ _coredumpctl_command(){
         local -a _dumps
         cmd="${${_coredumpctl_cmds[(r)$words[1]:*]%%:*}}"
         if (( $#cmd  )); then
-            # user can set zstyle ':completion:*:*:coredumpctl:*' sort no for coredumps to be ordered by date, otherwise they get ordered by pid
-            _dumps=( "${(foa)$(coredumpctl list --no-legend | awk 'BEGIN{OFS=":"} {sub(/[[ \t]+/, ""); print $4,$0}' 2>/dev/null)}" )
+            _dumps=( "${(f)$(coredumpctl list --no-legend | awk 'BEGIN{OFS=":"} {sub(/[[ \t]+/, ""); print $4,$0}' 2>/dev/null)}" )
             if [[ -n "$_dumps" ]]; then
-                _describe -t pids 'coredumps' _dumps
+                _describe -V -t pids 'coredumps' _dumps
             else
                 _message "no coredumps"
             fi