From f2621414ee5f2f601424c22f00e207903e3b6104 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 03:03:18 +0200 Subject: Merging upstream version 1:2.12.0. Signed-off-by: Daniel Baumann --- completions/strace | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'completions/strace') diff --git a/completions/strace b/completions/strace index 2b46ce8..917f64d 100644 --- a/completions/strace +++ b/completions/strace @@ -1,9 +1,9 @@ # bash completion for strace -*- shell-script -*- -_strace() +_comp_cmd_strace() { - local cur prev words cword - _init_completion -n = || return + local cur prev words cword comp_args + _comp_initialize -n = -- "$@" || return # check if we're still completing strace local offset=0 i @@ -22,7 +22,7 @@ _strace() done if ((offset > 0)); then - _command_offset $offset + _comp_command_offset $offset else case $prev in @@ -38,11 +38,11 @@ _strace() local define syscall rest local -A syscalls while read -r define syscall rest; do - [[ $define == "#define" && \ - $syscall =~ ^__NR_(.+) ]] && - syscalls[${BASH_REMATCH[1]}]=1 + [[ $define == "#define" && + $syscall =~ ^__NR_(.+) ]] && + syscalls[${BASH_REMATCH[1]}]=set done 2>/dev/null /dev/null <$unistd fi - COMPREPLY=($(compgen -W '${!syscalls[@]} file - process network signal ipc desc all none' \ - -- "$cur")) + _comp_compgen -- -W \ + '${syscalls[@]+"${!syscalls[@]}"} file process + network signal ipc desc all none' return ;; esac else compopt -o nospace - COMPREPLY=($(compgen -S"=" -W 'trace abbrev verbose raw - signal read write' -- "$cur")) + _comp_compgen -- -S"=" -W 'trace abbrev verbose raw signal + read write' fi return ;; -*o) - _filedir + _comp_compgen_filedir return ;; -*p) - _pids + _comp_compgen_pids return ;; -*S) - COMPREPLY=($(compgen -W 'time calls name nothing' -- "$cur")) + _comp_compgen -- -W 'time calls name nothing' return ;; -*u) - _allowed_users + _comp_compgen_allowed_users return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) + _comp_compgen_help -- -h else - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen_commands fi fi } && - complete -F _strace -o default strace + complete -F _comp_cmd_strace -o default strace # ex: filetype=sh -- cgit v1.2.3