From 3635aa19e8e624ad3336530184a49bef7b415b2d Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Date: Tue, 24 Jul 2012 23:17:48 +0530 Subject: [PATCH] Refactoring to prefer arrays over string hacks. The position_args variable is now an array, instead of a string with argument names split by a space. This feels much cleaner. --- antigen.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/antigen.zsh b/antigen.zsh index f37c9a5..1cca2bc 100644 --- a/antigen.zsh +++ b/antigen.zsh @@ -19,10 +19,11 @@ antigen-bundle () { local btype=plugin # Set spec values based on the positional arguments. - local position_args='url loc' + local position_args + position_args=(url loc) local i=1 while ! [[ -z $1 || $1 == --*=* ]]; do - local arg_name="$(echo "$position_args" | cut -d\ -f$i)" + local arg_name="${position_args[$i]}" local arg_value="$1" eval "local $arg_name='$arg_value'" shift -- 2.0.0