From 43dba65eb9e9b2c630113067cbee00f4f248650e Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Thu, 3 Oct 2013 23:11:02 +0100 Subject: [PATCH] Improve command parsing logic --- src/bin/dotify | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bin/dotify b/src/bin/dotify index 480da48..9a5104d 100755 --- a/src/bin/dotify +++ b/src/bin/dotify @@ -93,7 +93,11 @@ fi # Command is first argument that does not start with a dash or plus. for arg in "$@"; do - if [[ "$arg" != "-"* ]] && [[ "$arg" != "+"* ]]; then + if [ -n "$skip_next" ]; then + skip_next= + elif [[ "$arg" =~ ^(--dotfile|-f|--taraget|-t)$ ]]; then + skip_next=1 + elif [[ "$arg" != "-"* ]] && [[ "$arg" != "+"* ]]; then command="$arg" break fi