Improve command parsing logic

This commit is contained in:
2013-10-03 23:11:02 +01:00
parent b26031c4ea
commit 43dba65eb9

View File

@@ -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