summaryrefslogtreecommitdiff
path: root/completions/screen
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gabriel@inconstante.net.br>2019-08-07 09:17:13 -0300
committerGabriel F. T. Gomes <gabriel@inconstante.net.br>2019-08-07 09:17:13 -0300
commit5732da2af736c40cf693354485446ab4867ecb4d (patch)
tree76d76cdfa16ca62d20fb109da13895ec64fff110 /completions/screen
parent9cd22d1df8f0f5b554858471c86faa9f37b8fed4 (diff)
downloadbash-completion-5732da2af736c40cf693354485446ab4867ecb4d.tar.gz
New upstream version 2.9upstream/2.9
Diffstat (limited to 'completions/screen')
-rw-r--r--completions/screen32
1 files changed, 16 insertions, 16 deletions
diff --git a/completions/screen b/completions/screen
index 6b5c319f..3b9fb272 100644
--- a/completions/screen
+++ b/completions/screen
@@ -2,22 +2,22 @@
_screen_sessions()
{
- local sessions=( $( command screen -ls | command sed -ne \
- 's|^\t\{1,\}\([0-9]\{1,\}\.[^\t]\{1,\}\).*'"$1"'.*$|\1|p' ) )
+ local sessions=( $(command screen -ls | command sed -ne \
+ 's|^\t\{1,\}\([0-9]\{1,\}\.[^\t]\{1,\}\).*'"$1"'.*$|\1|p') )
if [[ $cur == +([0-9])?(.*) ]]; then
# Complete sessions including pid prefixes
- COMPREPLY=( $( compgen -W '${sessions[@]}' -- "$cur" ) )
+ COMPREPLY=( $(compgen -W '${sessions[@]}' -- "$cur") )
else
# Create unique completions, dropping pids where possible
local -A res
local i tmp
- for i in ${sessions[@]}; do
+ for i in "${sessions[@]}"; do
res[${i/#+([0-9])./}]+=" $i"
done
- for i in ${!res[@]}; do
+ for i in "${!res[@]}"; do
[[ ${res[$i]} == \ *\ * ]] && tmp+=" ${res[$i]}" || tmp+=" $i"
done
- COMPREPLY=( $( compgen -W '$tmp' -- "$cur" ) )
+ COMPREPLY=( $(compgen -W '$tmp' -- "$cur") )
fi
} &&
_screen()
@@ -27,7 +27,7 @@ _screen()
if ((cword > 2)); then
case ${words[cword-2]} in
- -[dD])
+ -*[dD])
_screen_sessions
return
;;
@@ -37,7 +37,7 @@ _screen()
local i
for (( i=1; i <= cword; i++ )); do
case ${words[i]} in
- -r|-R|-d|-D|-x|-s|-c|-T|-e|-h|-p|-S|-t)
+ -*[rRdDxscTehpSt])
(( i++ ))
continue
;;
@@ -51,26 +51,26 @@ _screen()
done
case $prev in
- -[rR])
+ -*[rR])
# list detached
_screen_sessions 'Detached'
return
;;
- -[dD])
+ -*[dD])
# list attached
_screen_sessions 'Attached'
return
;;
- -x)
+ -*x)
# list both
_screen_sessions
return
;;
- -s)
+ -*s)
_shells
return
;;
- -c)
+ -*c)
_filedir
return
;;
@@ -78,15 +78,15 @@ _screen()
_terms
return
;;
- -e|-h|-p|-S|-t)
+ -*[ehpSt])
return
;;
esac
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '-a -A -c -d -D -e -f -fn -fa -h -i -ln -list
+ COMPREPLY=( $(compgen -W '-a -A -c -d -D -e -f -fn -fa -h -i -ln -list
-L -m -O -p -q -r -R -s -S -t -T -U -v -wipe -x -X --help
- --version' -- "$cur" ) )
+ --version' -- "$cur") )
fi
} &&
complete -F _screen screen