Complete screen on commands (Alioth: #312164, RedHat: #547852).

This commit is contained in:
Ville Skyttä 2011-04-25 15:51:33 +03:00
parent b029dfd823
commit 976ba44825
2 changed files with 23 additions and 3 deletions

View File

@ -22,6 +22,22 @@ _screen()
esac
fi
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)
(( i++ ))
continue
;;
-*)
continue
;;
esac
_command_offset $i
return
done
case $prev in
-[rR])
# list detached
@ -61,7 +77,7 @@ _screen()
--version' -- "$cur" ) )
fi
} &&
complete -F _screen -o default screen
complete -F _screen screen
# Local variables:
# mode: shell-script

View File

@ -12,15 +12,19 @@ setup
assert_complete_any "screen -"
sync_after_int
assert_complete {bar "bar bar.d/" foo foo.d/} \
"screen -c $::srcdir/fixtures/shared/default/" "-c should complete files/dirs"
sync_after_int
assert_complete_any "screen cat"
sync_after_int
assert_complete_any "screen -T foo cat"
sync_after_int