Commit 08913bf7 authored by Frank Terbeck's avatar Frank Terbeck

grmlprompt: grml_reference_parameter does not have to know a target name

parent 8092bc73
...@@ -198,11 +198,10 @@ grml_theme_add_token: Token `%s'\'' exists! Giving up!\n\n' $name ...@@ -198,11 +198,10 @@ grml_theme_add_token: Token `%s'\'' exists! Giving up!\n\n' $name
function grml_reference_parameter () { function grml_reference_parameter () {
emulate -L zsh emulate -L zsh
local target="$1" local name="$1"
local new="$2"
if (( ${+parameters[$new]} )); then if (( ${+parameters[$name]} )); then
REPLY="${(P)new}" REPLY="${(P)name}"
else else
REPLY='' REPLY=''
fi fi
...@@ -230,10 +229,10 @@ function grml_prompt_addto () { ...@@ -230,10 +229,10 @@ function grml_prompt_addto () {
else else
case $it in case $it in
battery) battery)
grml_reference_parameter $target $new grml_reference_parameter $new
;; ;;
change-root) change-root)
grml_reference_parameter $target $new grml_reference_parameter $new
;; ;;
grml-chroot) grml-chroot)
if [[ -n ${(P)new} ]]; then if [[ -n ${(P)new} ]]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment