diff --git a/src/sns.src.sh b/src/sns.src.sh index 8cce229..88f76b5 100644 --- a/src/sns.src.sh +++ b/src/sns.src.sh @@ -98,14 +98,14 @@ NOTE="" if [ -z "$1" ]; then help; exit 20 else INDEX=0 - for ARG in "$@"; do + while getopts ":cCd:xe:xl:xp:xhi" ARG $VCTL; do let INDEX++ case "$ARG" in - -c|--create) + c|--create) CREATE="TRUE" OP="TRUE" ;; - -C|--config) + C|--config) if [ -z "$EDITOR" ]; then printf "$YELLOW_COLOR!$RESET_COLOR - %s\n"\ "No editor defined. Defaulting to vi." @@ -114,32 +114,27 @@ else "$EDITOR" "$CONFIG_FILE" exit 0; ;; - -d|--delete) + d|--delete) DELETE="TRUE" OP="TRUE" ;; - -e|--edit) + e|--edit) EDIT="TRUE" OP="TRUE" ;; - -ce|-ec) - CREATE="TRUE" - EDIT="TRUE" - OP="TRUE" - ;; - -l|--list) + l|--list) LIST="TRUE" OP="TRUE" ;; - -p|--print) + p|--print) PRINT="TRUE" OP="TRUE" ;; - -h|--help) + h|--help) help exit 0 ;; - -i|--init-store) + i|--init-store) init_store exit 0 ;;