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
function grml_reference_parameter () {
emulate -L zsh
local target="$1"
local new="$2"
local name="$1"
if (( ${+parameters[$new]} )); then
REPLY="${(P)new}"
if (( ${+parameters[$name]} )); then
REPLY="${(P)name}"
else
REPLY=''
fi
......@@ -230,10 +229,10 @@ function grml_prompt_addto () {
else
case $it in
battery)
grml_reference_parameter $target $new
grml_reference_parameter $new
;;
change-root)
grml_reference_parameter $target $new
grml_reference_parameter $new
;;
grml-chroot)
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