From a64c63680a15e2e27a04d41ddea05fa742bfbe7d Mon Sep 17 00:00:00 2001 From: pvincent Date: Fri, 7 Aug 2026 23:08:54 +0400 Subject: [PATCH] small fix --- README.md | 2 +- bin/miaou-bash | 16 +++++++++------- lib/uninstall.bash | 4 ++++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 647041d..4e1cdbb 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ miaou-bash --self-upgrade ## uninstall ```bash -TODO: miaou-bash --uninstall +miaou-bash --uninstall ``` diff --git a/bin/miaou-bash b/bin/miaou-bash index 4a6872c..88c7608 100755 --- a/bin/miaou-bash +++ b/bin/miaou-bash @@ -613,13 +613,15 @@ function usage { function parse_options { [[ $# == 0 ]] && >&2 echo 'ERROR: script expected!' && builtin exit 2 - [[ $# == 1 ]] && case "$1" in - --help) usage && builtin exit ;; - --version) cat "${MIAOU_BASH_DIR:-/opt/miaou-bash}/.semver_git_tag" && builtin exit ;; - --self-upgrade) self_upgrade && builtin exit ;; - --uninstall) uninstall && builtin exit ;; - -*) >&2 echo "ERROR: option '$1' unknown!" && usage && builtin exit 2 ;; - esac + if [[ $# == 1 ]]; then + case "$1" in + --help) usage && builtin exit ;; + --version) cat "${MIAOU_BASH_DIR:-/opt/miaou-bash}/.semver_git_tag" && builtin exit ;; + --self-upgrade) self_upgrade && builtin exit ;; + --uninstall) uninstall && builtin exit ;; + -*) >&2 echo "ERROR: option '$1' unknown!" && usage && builtin exit 2 ;; + esac + fi [[ $1 =~ ^- ]] && >&2 echo "ERROR: too many args $#, either single option or SCRIPT + args accepted!" && builtin exit 2 SCRIPT="$1" [[ ! -v SCRIPT ]] && >&2 echo 'ERROR: script expected!' && builtin exit 2 diff --git a/lib/uninstall.bash b/lib/uninstall.bash index bbdcb88..eb9ea60 100644 --- a/lib/uninstall.bash +++ b/lib/uninstall.bash @@ -5,6 +5,10 @@ cd || exit +source "$MIAOU_BASH_DIR"/lib/functions.bash + +_confirm_destructive + if [[ -f /etc/bash.bashrc.ORIGINAL ]]; then rm /etc/bash.bashrc mv /etc/bash.bashrc.ORIGINAL /etc/bash.bashrc