Summary
Add System.CommandLine Option for OpenCLI Specification via --open-cli or --opencli.
Remarks
An OpenCLI Description is a single JSON or YAML document that conforms to the OpenCLI Specification.
see: https://opencli.org/#opencli-description
The OpenCLI Specification is built-in to Spectre.Console.Cli through exe cli opencli and exe --help-dump-opencli.
See: https://spectreconsole.net/cli/reference/built-in-command-behaviors/#opencli-command
Features
- Add a public API that adds an
Option<bool> to System.CommandLine applications
Option<bool> should not be recursive, to allow to JSONify only the RootCommand
Option<bool> should be hidden, to not show in the help output
- Might accept optional JSON-Serializer options
- Add a parameter for the OpenCLI Version as
enum or struct
- Mark OpenCLI-Version-related APIs
[Experimental]
- the OpenCLI Specification is currently a draft/proposal in Version 0.1
- there are still breaking changes to the draft/proposal of Version 0.1
- documentation should mention the date of the current revision in use
- see changelog: https://opencli.org/
- Should be Trim-friendly and AOT-compatible, or have an overload that is
- Use
System.Text.Json to output the JSON representation
- target frameworks without built-in support as part of the shared framework should use the System.Text.Json NuGet package
- Use StringSyntaxAttribute.Json for testing
- Add Benchmarks for relevant
public members
- Set appropriate
<TargetFrameworks> for the Library
- use multi-targeting for the Test project
- Ensure to be callable/invocable from
C#, F#, and Visual Basic
Example
See: https://opencli.org/examples
See also
Summary
Add
System.CommandLineOption for OpenCLI Specification via--open-clior--opencli.Remarks
The OpenCLI Specification is built-in to Spectre.Console.Cli through
exe cli opencliandexe --help-dump-opencli.See: https://spectreconsole.net/cli/reference/built-in-command-behaviors/#opencli-command
Features
Option<bool>toSystem.CommandLineapplicationsOption<bool>should not be recursive, to allow to JSONify only the RootCommandOption<bool>should be hidden, to not show in the help outputenumorstruct[Experimental]System.Text.Jsonto output the JSON representationpublicmembers<TargetFrameworks>for the LibraryC#,F#, andVisual BasicExample
See: https://opencli.org/examples
See also
System.CommandLinerepository: https://github.com/dotnet/command-line-apiSystem.CommandLinedocumentation: https://learn.microsoft.com/dotnet/standard/commandline/System.Text.Jsondocumentation: https://learn.microsoft.com/dotnet/standard/serialization/system-text-json/overviewSpectre.Console.Clirepository: https://github.com/spectreconsole/spectre.console.cli