Changeset

6329:c95dffd984a4

mod_rest: Add -v flag to example script to allow increasing verbosity
author Kim Alvefur <zash@zash.se>
date Thu, 03 Jul 2025 17:50:18 +0200
parents 6328:887ed0f6e275
children 6330:27e061d455b9
files mod_rest/example/rest.sh
diffstat 1 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_rest/example/rest.sh	Thu Jul 03 17:49:08 2025 +0200
+++ b/mod_rest/example/rest.sh	Thu Jul 03 17:50:18 2025 +0200
@@ -18,6 +18,7 @@
 # Settings
 HOST=""
 DOMAIN=""
+PRINT="b"
 
 SESSION="session-read-only"
 
@@ -35,8 +36,21 @@
 	exit 1
 fi
 
-while getopts 'r:h:' flag; do
+while getopts 'vr:h:' flag; do
 	case "$flag" in
+		v)
+			case "$PRINT" in
+				b)
+					PRINT="Bb"
+					;;
+				Bb)
+					PRINT="HBhb"
+					;;
+				HBhb)
+					PRINT="HBhbm"
+					;;
+			esac
+			;;
 		r)
 			case "$OPTARG" in
 				o)
@@ -88,4 +102,4 @@
 	shift 1
 fi
 
-https --check-status -p b --"$SESSION" rest -A oauth2 -a "$HOST" --oauth2-scope "$SCOPE" "$HOST/rest$GET_PATH" "$@"
+https --check-status -p "$PRINT" --"$SESSION" rest -A oauth2 -a "$HOST" --oauth2-scope "$SCOPE" "$HOST/rest$GET_PATH" "$@"