2021-06-16 19:35:12 +00:00
|
|
|
#compdef coredumpctl
|
2020-11-09 04:23:58 +00:00
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
2013-07-29 19:09:10 +00:00
|
|
|
|
2018-12-24 11:15:38 +00:00
|
|
|
(( $+functions[_coredumpctl_commands] )) ||
|
|
|
|
_coredumpctl_commands(){
|
2014-06-19 11:46:01 +00:00
|
|
|
local -a _coredumpctl_cmds
|
|
|
|
_coredumpctl_cmds=(
|
2019-04-05 09:39:14 +00:00
|
|
|
'list:List available coredumps'
|
|
|
|
'info:Show detailed information about one or more coredumps'
|
|
|
|
'dump:Print coredump to stdout'
|
|
|
|
'debug:Start debugger (gdb) on a coredump'
|
2013-07-29 19:09:10 +00:00
|
|
|
)
|
|
|
|
if (( CURRENT == 1 )); then
|
2014-06-19 11:46:01 +00:00
|
|
|
_describe -t commands 'coredumpctl command' _coredumpctl_cmds
|
2013-07-29 19:09:10 +00:00
|
|
|
else
|
|
|
|
local curcontext="$curcontext"
|
|
|
|
local -a _dumps
|
2014-06-19 11:46:01 +00:00
|
|
|
cmd="${${_coredumpctl_cmds[(r)$words[1]:*]%%:*}}"
|
2013-07-29 19:09:10 +00:00
|
|
|
if (( $#cmd )); then
|
2018-12-31 20:27:09 +00:00
|
|
|
_dumps=( "${(f)$(coredumpctl list -q --no-legend | awk 'BEGIN{OFS=":"} {sub(/[[ \t]+/, ""); print $4,$0}' 2>/dev/null)}" )
|
2013-07-29 19:09:10 +00:00
|
|
|
if [[ -n "$_dumps" ]]; then
|
2018-01-13 14:23:28 +00:00
|
|
|
_describe -V -t pids 'coredumps' _dumps
|
2013-07-29 19:09:10 +00:00
|
|
|
else
|
|
|
|
_message "no coredumps"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
_message "no more options"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
_arguments \
|
2024-04-15 08:58:48 +00:00
|
|
|
'(-o --output)'{-o+,--output=}'[Write output to FILE]:output file:_files' \
|
|
|
|
'(-F --field)'{-F+,--field=}'[Show field in list output]:field' \
|
2015-01-12 20:26:27 +00:00
|
|
|
'-1[Show information about most recent entry only]' \
|
2024-04-15 08:58:48 +00:00
|
|
|
'(-S --since)'{-S,--since}'[Print entries since the specified date]' \
|
|
|
|
'(-U --until)'{-U,--until}'[Print entries until the specified date]' \
|
|
|
|
'(-r --reverse)'{-r,--reverse}'[Show the newest entries first]' \
|
2013-07-29 19:09:10 +00:00
|
|
|
'--no-pager[Do not pipe output into a pager]' \
|
2015-01-12 20:26:27 +00:00
|
|
|
'--no-legend[Do not print the column headers]' \
|
2024-04-15 08:58:48 +00:00
|
|
|
'(- *)'{-h,--help}'[Show this help]' \
|
|
|
|
'(- *)--version[Show package version]' \
|
2018-12-25 18:30:50 +00:00
|
|
|
'--debugger=[Use the given debugger]:debugger: _command_names -e' \
|
2024-04-15 08:58:48 +00:00
|
|
|
'(-D --directory)'{-D,--directory=}'[Use the journal files in the specified dir]:directory: _directories' \
|
|
|
|
'(-q --quiet)'{-q,--quiet}'[Do not show info messages and privilege warning]' \
|
2021-10-06 12:47:46 +00:00
|
|
|
'--all[Look at all journal files instead of local ones]' \
|
2018-12-24 11:15:38 +00:00
|
|
|
'*::coredumpctl commands:_coredumpctl_commands'
|