aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLena <lena@omega>2026-07-01 00:00:00 +0000
committerLena <lena@omega>2026-07-01 00:00:00 +0000
commite4b9241441cc0d3204999da7077535452aa7d43c (patch)
tree99e58e286e5e751c8299dfa84bfcf68250e6efdd /test
parent1cd6695315d52b4d5417fbb9fb8ad3b8c0063104 (diff)
downloadscrcpy-android-e4b9241441cc0d3204999da7077535452aa7d43c.tar.gz
test: print --help from the header comment block
The sed line range broke silently whenever the header grew or shrank. Print from line 2 down to the first non-comment line instead, so the usage text tracks the header.
Diffstat (limited to 'test')
-rwxr-xr-xtest4
1 files changed, 3 insertions, 1 deletions
diff --git a/test b/test
index 7ccfc8f..242cee3 100755
--- a/test
+++ b/test
@@ -24,7 +24,9 @@ cmd="${1:-unit}"
case "$cmd" in
unit|e2e|all|record|apk) ;;
-h|--help)
- sed -n '2,14p' "$0" >&2
+ # Usage is the header comment block: print from line 2 down to
+ # the first non-comment line.
+ awk 'NR > 1 && /^#/ { sub(/^# ?/, ""); print; next } NR > 1 { exit }' "$0" >&2
exit 0 ;;
*)
echo "usage: $0 [unit|e2e|all|record|apk]" >&2