remove deprecated output flags

This commit is contained in:
Sean Channel 2012-12-05 14:20:45 -08:00
parent 63c090270c
commit 7c87e594da

View File

@ -15,17 +15,17 @@
_salt_get_grains(){ _salt_get_grains(){
if [ "$1" = 'local' ] ; then if [ "$1" = 'local' ] ; then
salt-call --text-out -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g' salt-call -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g'
else else
salt '*' --timeout 2 --text-out -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g' salt '*' --timeout 2 -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g'
fi fi
} }
_salt_get_grain_values(){ _salt_get_grain_values(){
if [ "$1" = 'local' ] ; then if [ "$1" = 'local' ] ; then
salt-call --text-out -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$' salt-call -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$'
else else
salt '*' --timeout 2 --text-out -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$' salt '*' --timeout 2 -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$'
fi fi
} }
@ -42,7 +42,7 @@ _salt(){
ppprev="${COMP_WORDS[COMP_CWORD-3]}" ppprev="${COMP_WORDS[COMP_CWORD-3]}"
fi fi
opts="--help -h --version -c --compound --raw-out --text-out --json-out --no-color \ opts="--help -h --version -c --compound \
--timeout -t --static -s --batch-size -b -E --pcre -L --list \ --timeout -t --static -s --batch-size -b -E --pcre -L --list \
-G --grain --grain-pcre -X --exsel -N --nodegroup -R --range --return \ -G --grain --grain-pcre -X --exsel -N --nodegroup -R --range --return \
-Q --query -c --config -s --static -t --timeout \ -Q --query -c --config -s --static -t --timeout \
@ -85,11 +85,11 @@ _salt(){
return 0 return 0
;; ;;
salt) salt)
COMPREPLY=($(compgen -W "\'*\' ${opts} `salt-key --no-color -l acc`" -- ${cur})) COMPREPLY=($(compgen -W "\'*\' ${opts} `salt-key -l acc`" -- ${cur}))
return 0 return 0
;; ;;
-E|--pcre) -E|--pcre)
COMPREPLY=($(compgen -W "`salt-key --no-color -l acc`" -- ${cur})) COMPREPLY=($(compgen -W "`salt-key -l acc`" -- ${cur}))
return 0 return 0
;; ;;
-G|--grain|--grain-pcre) -G|--grain|--grain-pcre)
@ -118,7 +118,7 @@ _salt(){
;; ;;
esac esac
_salt_coms="$(salt '*' --timeout 2 --text-out -- sys.list_functions | sed 's/^.*\[//' | tr -d ",']" )" _salt_coms="$(salt '*' --timeout 2 -- sys.list_functions | sed 's/^.*\[//' | tr -d ",']" )"
all="${opts} ${_salt_coms}" all="${opts} ${_salt_coms}"
COMPREPLY=( $(compgen -W "${all}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${all}" -- ${cur}) )
@ -158,15 +158,15 @@ _saltkey(){
case "${prev}" in case "${prev}" in
-a|--accept) -a|--accept)
COMPREPLY=($(compgen -W "$(salt-key -l un --no-color; salt-key -l rej --no-color)" -- ${cur})) COMPREPLY=($(compgen -W "$(salt-key -l un; salt-key -l rej)" -- ${cur}))
return 0 return 0
;; ;;
-r|--reject) -r|--reject)
COMPREPLY=($(compgen -W "$(salt-key -l acc --no-color)" -- ${cur})) COMPREPLY=($(compgen -W "$(salt-key -l acc)" -- ${cur}))
return 0 return 0
;; ;;
-d|--delete) -d|--delete)
COMPREPLY=($(compgen -W "$(salt-key -l acc --no-color; salt-key -l un --no-color; salt-key -l rej --no-color)" -- ${cur})) COMPREPLY=($(compgen -W "$(salt-key -l acc; salt-key -l un; salt-key -l rej)" -- ${cur}))
return 0 return 0
;; ;;
-c|--config) -c|--config)
@ -185,7 +185,7 @@ _saltkey(){
return 0 return 0
;; ;;
-p|--print) -p|--print)
COMPREPLY=($(compgen -W "$(salt-key -l acc --no-color; salt-key -l un --no-color; salt-key -l rej --no-color)" -- ${cur})) COMPREPLY=($(compgen -W "$(salt-key -l acc; salt-key -l un; salt-key -l rej)" -- ${cur}))
return 0 return 0
;; ;;
-l|--list) -l|--list)
@ -207,7 +207,7 @@ _saltcall(){
COMPREPLY=() COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}" cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}" prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-h --help -l --log-level -d --doc -m --module-dirs --raw-out --text-out --yaml-out --json-out --no-color" opts="-h --help -l --log-level -d --doc -m --module-dirs"
if [ ${COMP_CWORD} -gt 2 ]; then if [ ${COMP_CWORD} -gt 2 ]; then
pprev="${COMP_WORDS[COMP_CWORD-2]}" pprev="${COMP_WORDS[COMP_CWORD-2]}"
fi fi
@ -244,7 +244,7 @@ _saltcall(){
;; ;;
esac esac
_salt_coms="$(salt-call --text-out -- sys.list_functions|sed 's/^.*\[//' | tr -d ",']" )" _salt_coms="$(salt-call -- sys.list_functions|sed 's/^.*\[//' | tr -d ",']" )"
COMPREPLY=( $(compgen -W "${opts} ${_salt_coms}" -- ${cur} )) COMPREPLY=( $(compgen -W "${opts} ${_salt_coms}" -- ${cur} ))
return 0 return 0
} }
@ -272,7 +272,7 @@ _saltcp(){
case ${prev} in case ${prev} in
salt-cp) salt-cp)
COMPREPLY=($(compgen -W "${opts} `salt-key -l acc --no-color`" -- ${cur})) COMPREPLY=($(compgen -W "${opts} `salt-key -l acc`" -- ${cur}))
return 0 return 0
;; ;;
-t|--timeout) -t|--timeout)
@ -281,7 +281,7 @@ _saltcp(){
return 0 return 0
;; ;;
-E|--pcre) -E|--pcre)
COMPREPLY=($(compgen -W "`salt-key -l acc --no-color`" -- ${cur})) COMPREPLY=($(compgen -W "`salt-key -l acc`" -- ${cur}))
return 0 return 0
;; ;;
-L|--list) -L|--list)
@ -289,7 +289,7 @@ _saltcp(){
prefpart="${cur%,*}," prefpart="${cur%,*},"
postpart=${cur##*,} postpart=${cur##*,}
filt="^\($(echo ${cur}| sed 's:,:\\|:g')\)$" filt="^\($(echo ${cur}| sed 's:,:\\|:g')\)$"
helper=($(salt-key -l acc --no-color | grep -v "${filt}" | sed "s/^/${prefpart}/")) helper=($(salt-key -l acc | grep -v "${filt}" | sed "s/^/${prefpart}/"))
COMPREPLY=($(compgen -W "${helper[*]}" -- ${cur})) COMPREPLY=($(compgen -W "${helper[*]}" -- ${cur}))
return 0 return 0