This commit is contained in:
pvincent
2026-08-07 00:39:30 +04:00
parent d7961ea34f
commit 4091d2142d
3 changed files with 23 additions and 4 deletions
+11 -1
View File
@@ -265,6 +265,14 @@ function on_error {
fi
}
function self_upgrade {
sudo -E "$MIAOU_BASH_DIR/lib/self-upgrade.bash"
}
function uninstall {
echo "TODO: uninstall"
}
function populate_error_arrays {
local source=$1 line=$2 payload=$3
@@ -601,7 +609,7 @@ function cleanup {
}
function usage {
echo "$(basename "$0") <SCRIPT> [...SCRIPT_ARGS] | --version | --help"
echo "$(basename "$0") <SCRIPT> [...SCRIPT_ARGS] | --version | --help | --self-upgrade | --uninstall"
}
function parse_options {
@@ -609,6 +617,8 @@ function parse_options {
[[ $# == 1 ]] && case "$1" in
--help) usage && builtin exit ;;
--version) cat "$MIAOU_BASH_DIR/.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
[[ $1 =~ ^- ]] && >&2 echo "ERROR: too many args $#, either single option or SCRIPT + args accepted!" && builtin exit 2