From 19c0866b050a022406867aa650302f4efbf8e010 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Sat, 29 Apr 2023 09:24:26 -0400 Subject: CommandOptions (#2856) * WIP CommandOptions * Fix some output issues. * Simplify word wrapping. * Add file extensions. * Change how lookup takes place. Add appendSplit functions to StringUtil. Make Categories hold the index range of their options. * Small improvement. * Lookup with partial option names. * Associate user values. * Encoding flags in the name. * Refactor setting up of command options. * Use CommandOptions in slang-options. * Remove old help text. * Cache the CommandOptions on the Session. * Range checking. Fix bug in the Options handling. * Extra checks for validity. * Get categories directly. * Slight improvements over output. * Added NameValue types. * Fix typo. Remove some now unused diagnostics. Fix diagnostic in testing, as output has changed. * Add minimal usage message. * Remove platform executable extension from diagnostics output. * Some improvements around getting names from NameValue types. * Improve some option descriptions. * Small fixes. --- .../command-line/unknown-line-directive-mode.slang.expected | 2 +- tests/diagnostics/command-line/unknown-option.slang.expected | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/diagnostics/command-line') diff --git a/tests/diagnostics/command-line/unknown-line-directive-mode.slang.expected b/tests/diagnostics/command-line/unknown-line-directive-mode.slang.expected index eef953199..160d3dfc7 100644 --- a/tests/diagnostics/command-line/unknown-line-directive-mode.slang.expected +++ b/tests/diagnostics/command-line/unknown-line-directive-mode.slang.expected @@ -1,6 +1,6 @@ result code = 1 standard error = { -(1): error 24: unknown '#line' directive mode 'quizzical' +(1): error 62: unknown value for option. Valid values are 'none, source-map, default, standard, glsl' tests/diagnostics/command-line/unknown-line-directive-mode.slang -line-directive-mode quizzical ^ } diff --git a/tests/diagnostics/command-line/unknown-option.slang.expected b/tests/diagnostics/command-line/unknown-option.slang.expected index 5b99ce862..8f73029c6 100644 --- a/tests/diagnostics/command-line/unknown-option.slang.expected +++ b/tests/diagnostics/command-line/unknown-option.slang.expected @@ -3,6 +3,9 @@ standard error = { (1): error 17: unknown command-line option '-destroy-all-humans' tests/diagnostics/command-line/unknown-option.slang -destroy-all-humans ^ +Usage: slangc [options...] [--] + +For help: slangc -h } standard output = { } -- cgit v1.2.3