fix(cli): preserve optional argument boundaries
This commit is contained in:
+3
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user