Command attributes
The Energy.Attribute.Command namespace provides attributes for command-line option parsing.
OptionAttribute
Energy.Attribute.Command.OptionAttribute marks a field or property as a command-line option.
public class Options
{
[Energy.Attribute.Command.Option("input", Short = "i", Long = "input")]
public string Input;
[Energy.Attribute.Command.Option("output", Short = "o", Long = "output")]
public string Output;
[Energy.Attribute.Command.Option("verbose", Short = "v")]
public bool Verbose;
}
Properties
| Property | Description |
|---|---|
Name |
Primary option name. |
Short |
Short option name. |
Long |
Long option name. |
Alternatives |
Additional aliases. |
ArgumentAttribute
Energy.Attribute.Command.ArgumentAttribute marks a positional argument.
WelcomeAttribute
Energy.Attribute.Command.WelcomeAttribute provides welcome text for command-line applications.
See also
core-configurationfor attribute-driven configuration.core-shellfor option styles.base-commandfor fluent argument parsing.