Fix local variable leaks from bluez completions.

This commit is contained in:
Ville Skyttä 2011-04-17 13:44:06 +03:00
parent f1b4f1b982
commit a47aff8481
16 changed files with 156 additions and 0 deletions

View File

@ -13,6 +13,7 @@ bash-completion (2.x)
* Try both full path and basename completions for sudo etc (Alioth: #313065).
* Don't install completions for init.d backup files.
* Support tildes when recursively sourcing muttrc files (Debian: #615134).
* Fix local variable leaks from bluez completions.
[ Guillaume Rousse ]
* added puppet completion, using work from Mathieu Parent (sathieudebian.org)

View File

@ -55,6 +55,7 @@ _hcitool()
$split && return 0
local arg
_get_first_arg
if [ -z $arg ]; then
if [[ "$cur" == -* ]]; then
@ -129,6 +130,7 @@ _sdptool()
$split && return 0
local arg
_get_first_arg
if [ -z $arg ]; then
if [[ "$cur" == -* ]]; then
@ -213,6 +215,7 @@ _rfcomm()
;;
esac
local arg
_get_first_arg
if [ -z $arg ]; then
if [[ "$cur" == -* ]]; then
@ -254,6 +257,7 @@ _ciptool()
;;
esac
local arg
_get_first_arg
if [ -z $arg ]; then
if [[ "$cur" == -* ]]; then
@ -292,6 +296,7 @@ _dfutool()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--help --device' -- "$cur" ) )
else
local args
_count_args
case $args in
1)
@ -313,6 +318,7 @@ _hciconfig()
COMPREPLY=()
_get_comp_words_by_ref cur
local arg
_get_first_arg
if [ -z $arg ]; then
if [[ "$cur" == -* ]]; then
@ -362,6 +368,7 @@ _hciattach()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-n -p -t -b -s -l' -- "$cur" ) )
else
local args
_count_args
case $args in
1)
@ -413,6 +420,7 @@ _avctrl()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--help --quiet' -- "$cur" ) )
else
local args
_count_args
if [ $args -eq 1 ]; then
COMPREPLY=( $( compgen -W 'discover switch' -- "$cur" ) )

View File

@ -0,0 +1 @@
assert_source_completions avctrl

View File

@ -0,0 +1 @@
assert_source_completions ciptool

View File

@ -0,0 +1 @@
assert_source_completions dfutool

View File

@ -0,0 +1 @@
assert_source_completions hciattach

View File

@ -0,0 +1 @@
assert_source_completions hciconfig

View File

@ -0,0 +1 @@
assert_source_completions rfcomm

View File

@ -0,0 +1 @@
assert_source_completions sdptool

View File

@ -0,0 +1,20 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "avctrl "
sync_after_int
teardown

View File

@ -0,0 +1,20 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "ciptool "
sync_after_int
teardown

View File

@ -0,0 +1,20 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "dfutool "
sync_after_int
teardown

View File

@ -0,0 +1,20 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "hciattach "
sync_after_int
teardown

View File

@ -0,0 +1,20 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "hciconfig "
sync_after_int
teardown

View File

@ -0,0 +1,20 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "rfcomm "
sync_after_int
teardown

View File

@ -0,0 +1,20 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "sdptool "
sync_after_int
teardown