From 6d333dfa0d24fbb9481cb7b159834ec4271f2f7a Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Date: Sun, 26 Aug 2012 18:06:41 +0530 Subject: [PATCH] Fix #20. Using `sed -r` breaks antigen on Mac. The BSD version of `sed` apparently does not have the `-r` option. So, eliminated the use of `sed` in this place altogather. --- antigen.zsh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/antigen.zsh b/antigen.zsh index ce6b68e..1c0e0cc 100644 --- a/antigen.zsh +++ b/antigen.zsh @@ -418,7 +418,17 @@ antigen () { done local keyword_args="$( - echo "$positional_args" | tr , '\n' | sed -r 's/(\??)$/:\1/' + # Positional arguments can double up as keyword arguments too. + echo "$positional_args" | tr , '\n' | + while read line; do + if [[ $line == *\? ]]; then + echo "${line%?}:?" + else + echo "$line:" + fi + done + + # Specified keyword arguments. echo "$spec" | cut -d\; -f2 | tr , '\n' )" local keyword_args_count="$(echo $keyword_args | awk -F, '{print NF}')" -- 2.0.0