diff --git a/sdata/options/exp-uninstall.sh b/sdata/options/exp-uninstall.sh new file mode 100644 index 000000000..4e2b3a932 --- /dev/null +++ b/sdata/options/exp-uninstall.sh @@ -0,0 +1,29 @@ +# Handle args for subcmd: exp-uninstall +# shellcheck shell=bash + +showhelp(){ +echo -e "Usage: $0 exp-uninstall [OPTIONS]... + +Experimental unintallation. + +Options: + -h, --help Show this help message +" +} +# `man getopt` to see more +para=$(getopt \ + -o h \ + -l help \ + -n "$0" -- "$@") +[ $? != 0 ] && echo "$0: Error when getopt, please recheck parameters." && exit 1 +##################################################################################### +## getopt Phase 1 +# ignore parameter's order, execute options below first +eval set -- "$para" +while true ; do + case "$1" in + -h|--help) showhelp;exit;; + --) break ;; + *) shift ;; + esac +done diff --git a/setup b/setup index 706850208..746e537a2 100755 --- a/setup +++ b/setup @@ -20,16 +20,6 @@ case $1 in esac ##################################################################################### case ${SCRIPT_SUBCOMMAND} in - exp-uninstall) - #source ./sdata/options/exp-install.sh - source ./sdata/step/exp-uninstall.sh - exit - ;; - exp-update) - source ./sdata/options/exp-update.sh - source ./sdata/step/exp-update.sh - exit - ;; install) source ./sdata/options/install.sh if [[ "${SKIP_ALLGREETING}" != true ]]; then @@ -52,4 +42,14 @@ case ${SCRIPT_SUBCOMMAND} in fi fi ;; + exp-uninstall) + source ./sdata/options/exp-uninstall.sh + source ./sdata/step/exp-uninstall.sh + exit + ;; + exp-update) + source ./sdata/options/exp-update.sh + source ./sdata/step/exp-update.sh + exit + ;; esac