fix(cli): preserve optional argument boundaries

This commit is contained in:
2026-10-30 10:55:34 -03:00
parent b48be5b7b7
commit 97cb71eb80
4 changed files with 152 additions and 32 deletions
+3 -3
View File
@@ -53,8 +53,8 @@ cmd_config() {
cat "$CONFIG_FILE" | sed 's/^/ /'
;;
set)
local key="$3"
local value="$4"
local key="${3:-}"
local value="${4:-}"
[ -z "$key" ] || [ -z "$value" ] && {
info "Usage: ./unleash config set KEY VALUE"
info "Keys: WEBHOOK, LOG_LEVEL (verbose), LOG_FILE"
@@ -63,7 +63,7 @@ cmd_config() {
save_config "$key" "$value"
;;
unset)
local key="$3"
local key="${3:-}"
[ -z "$key" ] && { info "Usage: ./unleash config unset KEY"; return 1; }
if [ -f "$CONFIG_FILE" ]; then
_rewrite_config "$key" "" unset || return 1