From 6c09f2a45c5541e9c207d14fc7aa21a4a0066bde Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 03:03:19 +0200 Subject: Merging upstream version 1:2.12.0. Signed-off-by: Daniel Baumann --- completions/_su | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'completions/_su') diff --git a/completions/_su b/completions/_su index 1a03c8f..3354447 100644 --- a/completions/_su +++ b/completions/_su @@ -8,34 +8,32 @@ if [[ $OSTYPE != *linux* ]]; then return fi -_su() +_comp_cmd_su() { # linux-specific completion - local cur prev words cword split - _init_completion -s || return + local cur prev words cword was_split comp_args + _comp_initialize -s -- "$@" || return case "$prev" in -s | --shell) - _shells + _comp_compgen_shells return ;; -c | --command | --session-command) - local IFS=$'\n' - compopt -o filenames - COMPREPLY=($(compgen -d -c -- "$cur")) + _comp_compgen_commands return ;; esac - $split && return + [[ $was_split ]] && return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '$(_parse_help "$1" --help)' -- "$cur")) + _comp_compgen_help [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u } && - complete -F _su su + complete -F _comp_cmd_su su # ex: filetype=sh -- cgit v1.2.3