finalization: step-*.sh: optionally skip `repo upload`
Teach the step-*.sh scripts to parse command line options. Add support
for --dry-run, which will skip the part where the CLs are uploaded:
useful for local experiments.
Bug: 323940469
Test: croot && build/tools/finalization/step-1.sh --dry-run # verify no CLs uploaded
Ignore-AOSP-first: VIC finalization happens outside AOSP
Change-Id: Ia58da02ae7a69c24f8332c90d1c779884e3a1dab
diff --git a/tools/finalization/command-line-options.sh b/tools/finalization/command-line-options.sh
new file mode 100644
index 0000000..1c5df46
--- /dev/null
+++ b/tools/finalization/command-line-options.sh
@@ -0,0 +1,8 @@
+ARGV=$(getopt --options '' --long dry-run -- "$@")
+eval set -- "$ARGV"
+while true; do
+ case "$1" in
+ --dry-run) repo_upload_dry_run_arg="--dry-run"; shift ;;
+ *) break
+ esac
+done