mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 13:28:16 +08:00
Docs redesign (#728)
* Adding a dark mode * Adding reference for types to summary pages * Adding API Reference * Adding modifiers to methods/fields/etc * Minimizing files input * Caching a lot of the output pages * Cache only for each execution * Adding API references to existing docs
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
Title: CommandApp
|
||||
Order: 2
|
||||
Description: "**CommandApp** is the entry point for a *Spectre.Console.Cli* command line application. It is used to configure the settings and commands used for execution of the application."
|
||||
Reference:
|
||||
- T:Spectre.Console.Cli.CommandApp
|
||||
- T:Spectre.Console.Cli.CommandApp`1
|
||||
---
|
||||
|
||||
`CommandApp` is the entry point for a `Spectre.Console.Cli` command line application. It is used to configure the settings and commands used for execution of the application. Most `Spectre.Console.Cli` applications will need to specify a custom configuration using the `Configure` method.
|
||||
|
@ -1,9 +1,12 @@
|
||||
Title: Creating Commands
|
||||
Order: 6
|
||||
Description: "How to create commands for *Spectre.Console.Cli*"
|
||||
Reference:
|
||||
- T:Spectre.Console.Cli.AsyncCommand`1
|
||||
- T:Spectre.Console.Cli.Command`1
|
||||
---
|
||||
|
||||
Commands in `Spectre.Console.Cli` are defined by creating a class that inherits from either `Spectre.Console.Cli.Command<TSettings>` or `Spectre.Console.Cli.AsyncCommand<TSettings>`. `Command<TSettings>` must implement an `Execute` method that returns an int where as `AsyncCommand<TSettings>` must implement `ExecuteAsync` returning `Task<int>`.
|
||||
Commands in `Spectre.Console.Cli` are defined by creating a class that inherits from either `Command<TSettings>` or `AsyncCommand<TSettings>`. `Command<TSettings>` must implement an `Execute` method that returns an int where as `AsyncCommand<TSettings>` must implement `ExecuteAsync` returning `Task<int>`.
|
||||
|
||||
```csharp
|
||||
public class HelloCommand : Command<HelloCommand.Settings>
|
||||
|
@ -1,6 +1,10 @@
|
||||
Title: Specifying Settings
|
||||
Order: 5
|
||||
Description: "How to define command line argument settings for your *Spectre.Console.Cli* Commands"
|
||||
Reference:
|
||||
- T:Spectre.Console.Cli.CommandSettings
|
||||
- T:Spectre.Console.Cli.CommandArgumentAttribute
|
||||
- T:Spectre.Console.Cli.CommandOptionAttribute
|
||||
---
|
||||
|
||||
Settings for `Spectre.Console.Cli` commands are defined via classes that inherit from `CommandSettings`. Attributes are used to indicate how the parser interprets the command line arguments and create a runtime instance of the settings to be used.
|
||||
|
Reference in New Issue
Block a user