nospace usage cleanups.

This commit is contained in:
Ville Skyttä 2011-04-21 12:53:32 +03:00
parent aa411dd30b
commit 448106b098
2 changed files with 7 additions and 44 deletions

View File

@ -1,9 +1,5 @@
# bash completion for sysbench
# We set -o nospace and turn it off in quite a few places for bash < 4
# reasons; assuming bash >= 4 we could instead not turn it on
# initially but only in the few cases where it's actually needed.
have sysbench || return
_sysbench()
@ -22,12 +18,10 @@ _sysbench()
return 0
;;
--init-rng|--debug|--validate)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) )
return 0
;;
--test)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'fileio cpu memory threads mutex oltp' \
-- "$cur" ) )
return 0
@ -36,98 +30,80 @@ _sysbench()
return 0
;;
--file-test-mode)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'seqwr seqrewr seqrd rndrd rndwr rndrw' \
-- "$cur" ) )
return 0
;;
--file-io-mode)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'sync async fastmmap slowmmap' \
-- "$cur" ) )
return 0
;;
--file-extra-flags)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'sync dsync direct' -- "$cur" ) )
return 0
;;
--file-fsync-all|--file-fsync-end)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) )
return 0
;;
--file-fsync-mode)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'fsync fdatasync' -- "$cur" ) )
return 0
;;
--memory-scope)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'global local' -- "$cur" ) )
return 0
;;
--memory-hugetlb)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) )
return 0
;;
--memory-oper)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'read write none' -- "$cur" ) )
return 0
;;
--memory-access-mode)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'seq rnd' -- "$cur" ) )
return 0
;;
--oltp-test-mode)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'simple complex nontrx sp' -- "$cur" ) )
return 0
;;
--oltp-read-only|--oltp-skip-trx|--oltp-quto-inc|--mysql-ssl)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) )
return 0
;;
--oltp-nontrx-mode)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'select update_key update_nokey insert
delete' -- "$cur" ) )
return 0
;;
--oltp-dist-type)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'uniform gaussian special' -- "$cur" ) )
return 0
;;
--db-driver)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W "$( $1 --test=oltp help 2>/dev/null |
sed -e '/^.*database drivers:/,/^$/!d' \
-ne 's/^ *\([^ ]*\) .*/\1/p' )" -- "$cur" ) )
return 0
;;
--db-ps-mode)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'auto disable' -- "$cur" ) )
return 0
;;
--mysql-socket)
compopt +o nospace &>/dev/null
_filedir sock
return 0
;;
--mysql-table-engine)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'myisam innodb bdb heap ndbcluster
federated' -- "$cur" ) )
return 0
;;
--mysql-engine-trx)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'yes no auto' -- "$cur" ) )
return 0
;;
@ -157,15 +133,14 @@ _sysbench()
if [[ "$cur" == -* || ! $test ]]; then
COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
[[ ${#COMPREPLY[@]} -eq 1 && ${COMPREPLY[0]} != *= ]] && \
compopt +o nospace &>/dev/null
[[ ${#COMPREPLY[@]} -eq 1 && ${COMPREPLY[0]} != *= ]] || \
compopt -o nospace
else
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W "prepare run cleanup help version" \
-- "$cur" ) )
fi
} &&
complete -F _sysbench -o nospace sysbench
complete -F _sysbench sysbench
# Local variables:
# mode: shell-script

View File

@ -1,9 +1,5 @@
# bash completion for cdrecord/wodim
# We set -o nospace and turn it off in several places for bash < 4
# reasons; assuming bash >= 4 we could instead not turn it on
# initially but only in the few cases where it's actually needed.
have cdrecord || have wodim || return
_cdrecord()
@ -19,11 +15,9 @@ _cdrecord()
cur=${cur#*=}
case $prev in
textfile|cuefile|msifile)
compopt +o nospace &>/dev/null
_filedir
;;
blank)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W 'help all fast track unreserve trtail
unclose session' -- "$cur" ) )
;;
@ -33,17 +27,14 @@ _cdrecord()
cur=${cur#*=}
case $prev in
varirec)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W "-2 -1 0 1 2" \
-- "$cur" ) )
;;
gigarec)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W "0.6 0.7 0.8 1.0 1.2 1.3
1.4" -- "$cur" ) )
;;
tattoofile)
compopt +o nospace &>/dev/null
_filedir
;;
esac
@ -52,17 +43,15 @@ _cdrecord()
gigarec= audiomaster forcespeed noforcespeed speedread
nospeedread singlesession nosinglesession hidecdr
nohidecdr tattooinfo tattoofile=' -- "$cur" ) )
[[ ${#COMPREPLY[@]} -eq 1 && ${COMPREPLY[0]} != *= ]] && \
compopt +o nospace &>/dev/null
[[ ${#COMPREPLY[@]} -eq 1 && ${COMPREPLY[0]} != *= ]] || \
compopt -o nospace
fi
;;
driver)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W "$( $1 driver=help 2>&1 | \
awk 'NR > 1 { print $1 }' ) help" -- "$cur" ) )
;;
minbuf)
compopt +o nospace &>/dev/null
COMPREPLY=( $( compgen -W "$( seq 25 95 2>/dev/null )" \
-- "$cur" ) )
;;
@ -103,10 +92,9 @@ _cdrecord()
if [ $track_mode -eq 0 ]; then
COMPREPLY+=( $( compgen -W '${generic_options[@]}' -- "$cur" ) )
fi
[[ ${#COMPREPLY[@]} -eq 1 && ${COMPREPLY[0]} != *= ]] && \
compopt +o nospace &>/dev/null
[[ ${#COMPREPLY[@]} -eq 1 && ${COMPREPLY[0]} != *= ]] || compopt -o nospace
} &&
complete -F _cdrecord -o nospace cdrecord wodim
complete -F _cdrecord cdrecord wodim
# Local variables:
# mode: shell-script