summaryrefslogtreecommitdiff
path: root/tools/specview.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-07 08:42:54 +0100
committerskal <pascal.massimino@gmail.com>2026-02-07 08:42:54 +0100
commitd51fe89516bb89f0a39f847370a1d43bc684d455 (patch)
tree4ea5887611aaaf9d3d25c074b807ee496a20d2c4 /tools/specview.cc
parent0a586bbbe8dc39a21e0edfc7b7f3ec4b72f0bc9b (diff)
feat(test_demo): Add validation for command-line options
Adds error handling for unknown or invalid command-line options: - Unknown options (e.g., --invalid) print error and help, then exit(1) - Missing arguments (e.g., --resolution without WxH) print error and help - Invalid format (e.g., --resolution abc) print error and help Error handling: - Prints specific error message to stderr - Shows full help text for reference - Exits with status code 1 (error) - --help still exits with status code 0 (success) Examples of new behavior: $ test_demo --unknown Error: Unknown option '--unknown' [help text displayed] $ test_demo --resolution Error: --resolution requires an argument (e.g., 1024x768) [help text displayed] $ test_demo --resolution abc Error: Invalid resolution format 'abc' (expected WxH, e.g., 1024x768) [help text displayed] This prevents silent failures and helps users discover correct usage. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'tools/specview.cc')
0 files changed, 0 insertions, 0 deletions