mirror of
https://github.com/DictXiong/dotfiles.git
synced 2026-11-05 19:48:15 +08:00
feat(riot): better help and fix option quite->quiet
This commit is contained in:
@@ -18,7 +18,7 @@ if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
|
||||
ARG="$1"; shift;
|
||||
fi
|
||||
case $ARG in
|
||||
-q*|--quite ) export DFS_QUIET=1 ;;
|
||||
-q*|--quiet ) export DFS_QUIET=1 ;;
|
||||
-l*|--lite ) export DFS_LITE=1 ;;
|
||||
-d*|--dev ) export DFS_DEV=1; set -x ;;
|
||||
-D*|--dry-run ) export DFS_DRY_RUN=1 ;;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
OPTS='-a -bcl --color --arg1=1 --arg2 2 " 1 2" yes'
|
||||
OPTS='-a -bcl --color --quiet --arg1=1 --arg2 2 " 1 2" yes'
|
||||
TARGET_OPTS='-a -b -c --arg1 1 --arg2 2 1 2 yes'
|
||||
eval set -- $OPTS
|
||||
|
||||
@@ -8,14 +8,14 @@ THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
||||
source "$THIS_DIR/common.sh"
|
||||
|
||||
test "${GOT_OPTS[*]}" = "$TARGET_OPTS"
|
||||
test $# -eq 8
|
||||
test $# -eq 9
|
||||
test "$*" = "${OPTS//\"/}"
|
||||
test "$DFS_LITE" = "1"
|
||||
is_tty
|
||||
test -z "$DFS_QUIET"
|
||||
test "$DFS_QUIET" = "1"
|
||||
|
||||
set +x
|
||||
echo "test passed, args:"
|
||||
for i in "${GOT_OPTS[@]}"; do
|
||||
echo "$i"
|
||||
done
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user