Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
2026-11-28 02:31:36 +00:00
parent fb79ce67b5
commit 84c5acbd31
+3 -43
View File
@@ -160,10 +160,10 @@ upload() {
api_response=$( curl \ api_response=$( curl \
-F file="@$file" \ -F file="@$file" \
-F format='json' \ -F format='json' \
-F flag_private="$flag_private" \ -F flag_private="${flag_private:-true}" \
-F secret="$secret" \ -F secret="$secret" \
-F tags="$tags" \ -F tags="$tags" \
-F notify="$flag_notify" \ -F notify="${flag_notify:-1}" \
-F void="${flag_void:-0}" \ -F void="${flag_void:-0}" \
-F submit="" \ -F submit="" \
"${misc_curl_args[@]}" \ "${misc_curl_args[@]}" \
@@ -347,45 +347,6 @@ get_token() {
fi 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() { main() {
declare args file target flag_private flag_rm flag_notify declare args file target flag_private flag_rm flag_notify
declare flag_shortlink declare flag_shortlink
@@ -530,5 +491,4 @@ main() {
esac esac
} }
set_argv "$@" main "$@"
main "${argv[@]}"