From f4acb49ea148cdd899f7f29f1591c7bc853c2135 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 03:03:18 +0200 Subject: Adding upstream version 1:2.12.0. Signed-off-by: Daniel Baumann --- completions/mtx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'completions/mtx') diff --git a/completions/mtx b/completions/mtx index b5c270b..d04a0c1 100644 --- a/completions/mtx +++ b/completions/mtx @@ -1,10 +1,10 @@ # mtx completion -*- shell-script -*- # by Jon Middleton -_mtx() +_comp_cmd_mtx() { - local cur prev words cword - _init_completion || return + local cur prev words cword comp_args + _comp_initialize -- "$@" || return local options tapes drives @@ -12,21 +12,21 @@ _mtx() inventory status load unload eepos first last next" tapes=$(mtx status 2>/dev/null | - awk '/Storage Element [0-9]+:Full/ { printf "%s ", $3 }') + _comp_awk '/Storage Element [0-9]+:Full/ { printf "%s ", $3 }') tapes=${tapes//:Full/} drives=$(mtx status 2>/dev/null | - awk '/Data Transfer Element [0-9]+:(Full|Empty)/ { printf "%s ", $4 }') + _comp_awk '/Data Transfer Element [0-9]+:(Full|Empty)/ { printf "%s ", $4 }') drives=${drives//:Full/} drives=${drives//:Empty/} if ((cword > 1)); then case $prev in load) - COMPREPLY=($(compgen -W "$tapes" -- "$cur")) + _comp_compgen -- -W "$tapes" ;; unload | first | last | next) - COMPREPLY=($(compgen -W "$drives" -- "$cur")) + _comp_compgen -- -W "$drives" ;; -f) true @@ -36,9 +36,9 @@ _mtx() ;; esac else - COMPREPLY=($(compgen -W "$options" -- "$cur")) + _comp_compgen -- -W "$options" fi } && - complete -F _mtx mtx + complete -F _comp_cmd_mtx mtx # ex: filetype=sh -- cgit v1.2.3