summaryrefslogtreecommitdiff
path: root/etc/functions/help
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-04-02 11:32:38 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-04-02 11:32:38 +0200
commitf0f3c02a3ccde07d3dc79577c7eca41ea3e8e86f (patch)
treed0aaab1de872a30a94555d2da3b501e13e18c217 /etc/functions/help
parent81ac4a06bff278f07620804b7d4120342b1f6522 (diff)
Replace $var by ${var}
Diffstat (limited to 'etc/functions/help')
-rw-r--r--etc/functions/help34
1 files changed, 17 insertions, 17 deletions
diff --git a/etc/functions/help b/etc/functions/help
index db3eca1..bad1b75 100644
--- a/etc/functions/help
+++ b/etc/functions/help
@@ -6,47 +6,47 @@ typeset method topic
typeset -i found check_only all
methods=(man zshfunction zshbuiltin apt)
-while [[ $1 == -* ]] {
- case $1 in
+while [[ ${1} == -* ]] {
+ case ${1} in
-a|--all) all=1 ;;
-c|--check-only) check_only=1 ;;
- -t|--topic) topic=$2; shift ;;
+ -t|--topic) topic=${2}; shift ;;
-|--) shift; break ;;
- *) echo "unknown option: $1" ;;
+ *) echo "unknown option: ${1}" ;;
esac
shift
}
-function help_check_man { man -w $1 &> /dev/null }
-function help_check_zshfunction { whichf $1 &> /dev/null }
+function help_check_man { man -w ${1} &> /dev/null }
+function help_check_zshfunction { whichf ${1} &> /dev/null }
function help_check_zshbuiltin { (( ${+builtins[$1]} )) }
function help_check_apt {
- [[ $commands[$1] != ${HOME}* ]] && [[ -n $commands[$1] ]] && [[ -n $commands[apt-file ]]
+ [[ ${commands[$1]} != ${HOME}* ]] && [[ -n ${commands[$1]} ]] && [[ -n ${commands[apt-file]} ]]
}
-function help_show_man { man $1 }
-function help_show_zshfunction { finfo $1 }
-function help_show_zshbuiltin { man zshbuiltins | less -p " $1" }
+function help_show_man { man ${1} }
+function help_show_zshfunction { finfo ${1} }
+function help_show_zshbuiltin { man zshbuiltins | less -p " ${1}" }
function help_show_apt {
- apt-cache show ${(s/:/)$(apt-file search -F $commands[$1])[1]}
+ apt-cache show ${(s/:/)$(apt-file search -F ${commands[$1]})[1]}
}
-if [[ -z $1 ]] {
+if [[ -z ${1} ]] {
echo "Usage: help <command>" > /dev/stderr
return 1
}
-for method in $methods; {
- if [[ -n $topic && $method != $topic ]] {
+for method in ${methods}; {
+ if [[ -n ${topic} && ${method} != ${topic} ]] {
continue
}
- if help_check_$method $1; then
+ if help_check_${method} ${1}; then
((found++))
if ((check_only)) {
- echo $method
+ echo ${method}
continue
}
- help_show_$method $1
+ help_show_${method} ${1}
((all)) || break
fi
}