From 47bb04252ceaf0e209ff59253ebe1d09c2d70146 Mon Sep 17 00:00:00 2001 From: Dict Xiong Date: Sat, 5 Nov 2022 19:22:13 +0800 Subject: [PATCH] install.sh: -q to be quiet --- install.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 57ccfbd..adf7f43 100755 --- a/install.sh +++ b/install.sh @@ -209,9 +209,14 @@ uninstall(){ fmt_note "done uninstalling!" } - -case $1 in - ""|-i ) install ;; - -r ) uninstall ;; - * ) fmt_warning "unknown command \"$1\". available: -i, -r" ;; -esac +BIN=install +while [[ $# > 0 ]]; do + case $1 in + -i ) BIN=install ;; + -r ) BIN=uninstall ;; + -q ) export DFS_QUIET=1 ;; + * ) fmt_warning "unknown command \"$1\". available: -i, -r"; exit 1 ;; + esac + shift +done +$BIN \ No newline at end of file