API Reference
CommandLine
Builds the command line equivalent to a set of answers, from each field's parameter name, so every interactive run teaches the non-interactive form. Values are quoted for the chosen style; switches appear only when on.
Inheritance
- Object
- CommandLine
Methods
public static String Argument(String name, Object? value, CommandStyle style) #StringFormats one argument: -Name value, a list, or a switch.
Parameters
- name System.String
- The parameter name.
- value System.Object?
- A string, number, bool (switch) or list.
- style ConsoleMonster.Interactive.CommandStyle
- The style.
Returns
The argument, or an empty string for an off switch or an empty value.
public static String Join(String command, IEnumerable<String> arguments) #StringJoins a command and its arguments, skipping empty ones.
Parameters
- command System.String
- The command.
- arguments System.Collections.Generic.IEnumerable<System.String>
- The arguments.
Returns
The command line.
public static String Parameter(String name, CommandStyle style) #StringFormats a parameter name for a style (Domain → -Domain, --domain or /domain).
Parameters
- name System.String
- The name, with or without its prefix.
- style ConsoleMonster.Interactive.CommandStyle
- The style.
Returns
The parameter as written on the command line.
public static String Quote(String value, CommandStyle style) #StringQuotes a value when the style needs it.
Parameters
- value System.String
- The value.
- style ConsoleMonster.Interactive.CommandStyle
- The style.
Returns
The value as written on the command line.
public static IReadOnlyList<String> Wrap(String command, Int32 width) #IReadOnlyList<String>Wraps a command line for display, breaking between arguments (a parameter stays with its value) and only inside an argument when it alone is wider than the line.
Parameters
- command System.String
- The command line.
- width System.Int32
- The line width.
Returns
The lines.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?