From 84c5acbd319b883001ceea3ae36d2210c3333ddb Mon Sep 17 00:00:00 2001 From: fbt Date: Sat, 28 Nov 2026 02:31:36 +0000 Subject: [PATCH] defaults Signed-off-by: fbt --- ufw | 46 +++------------------------------------------- 1 file changed, 3 insertions(+), 43 deletions(-) diff --git a/ufw b/ufw index 6173d05..b8cd29f 100755 --- a/ufw +++ b/ufw @@ -160,10 +160,10 @@ upload() { api_response=$( curl \ -F file="@$file" \ -F format='json' \ - -F flag_private="$flag_private" \ + -F flag_private="${flag_private:-true}" \ -F secret="$secret" \ -F tags="$tags" \ - -F notify="$flag_notify" \ + -F notify="${flag_notify:-1}" \ -F void="${flag_void:-0}" \ -F submit="" \ "${misc_curl_args[@]}" \ @@ -347,45 +347,6 @@ get_token() { fi } -set_argv() { - declare arg opt c - declare -g argv - - while (( $# )); do - unset -v arg opt c - - case "$1" in - (--) argv+=( "$1" ); shift; break;; - - (--*) - IFS='=' read arg opt <<< "$1" - argv+=( "$arg" ) - - [[ "$opt" ]] && { - argv+=( "$opt" ) - } - ;; - - (-*) - while read -n1 c - do - case "$c" in - -|'') :;; - *) argv+=( "-$c" );; - esac - done <<< "$1" - ;; - - (*) argv+=( "$1" );; - esac - shift - done - - if (( $# )); then - argv+=( "$@" ) - fi -} - main() { declare args file target flag_private flag_rm flag_notify declare flag_shortlink @@ -530,5 +491,4 @@ main() { esac } -set_argv "$@" -main "${argv[@]}" +main "$@"