diff options
| author | Lena <lena@omega> | 2026-07-01 00:00:00 +0000 |
|---|---|---|
| committer | Lena <lena@omega> | 2026-07-01 00:00:00 +0000 |
| commit | e4b9241441cc0d3204999da7077535452aa7d43c (patch) | |
| tree | 99e58e286e5e751c8299dfa84bfcf68250e6efdd | |
| parent | 1cd6695315d52b4d5417fbb9fb8ad3b8c0063104 (diff) | |
| download | scrcpy-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.
| -rwxr-xr-x | test | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 |