Static class that contains helpers related to printing a help text.
More...
|
static string | SplitToMultiline (string inputText, int maxLineLength, string sequentialPrefix) |
| Splits a given text in a series of lines with a given line prefix that fit in a given width. More...
|
|
static string | GetOptionUsagePart (Option option) |
| Processes a given Option and returns the usage part in POSIX format. More...
|
|
static string | GetOptionDetailsPart (Option option, uint shortOptionSpace=0, bool addValueToShort=false) |
| Processes a given Option and returns the details part. More...
|
|
static List< string > | GetUsageLines (Verb verb, string programName, uint consoleWidth=80, bool addVerbs=true) |
| Processes a given Verb to get the associated usage text in POSIX format as a list of lines. More...
|
|
static string | GetUsageString (Verb verb, string programName, uint consoleWidth=80, bool addVerbs=true) |
| Processes a given Verb to get the associated usage text in POSIX format. More...
|
|
static List< string > | GetOptionsDetailsLines (Verb verb, uint consoleWidth=80, uint leftSpace=2, uint innerSpace=2, bool addValueToShort=false) |
| Processes a given Verb to get the associated Options' details text in POSIX format as a list. More...
|
|
static string | GetOptionsDetails (Verb verb, uint consoleWidth=80, uint leftSpace=2, uint innerSpace=2, bool addValueToShort=false) |
| Processes a given Verb to get the associated Options' details text in POSIX format. More...
|
|
static string | GetVerbsDetails (Verb verb, uint consoleWidth=80, uint leftSpace=2, uint innerSpace=2) |
| Retrieves the sub-Verbs's details section for the given Verbs. More...
|
|
static string | GetFullHelpText (Verb verb, string programName, uint consoleWidth=80, uint leftSpace=2, uint innerSpace=2, bool addVerbs=true) |
| Retrieves the complete help text with the usage and verb/options info and description. More...
|
|
Static class that contains helpers related to printing a help text.
◆ GetFullHelpText()
static string NibblePoker.Library.Arguments.HelpText.GetFullHelpText |
( |
Verb |
verb, |
|
|
string |
programName, |
|
|
uint |
consoleWidth = 80 , |
|
|
uint |
leftSpace = 2 , |
|
|
uint |
innerSpace = 2 , |
|
|
bool |
addVerbs = true |
|
) |
| |
|
inlinestatic |
Retrieves the complete help text with the usage and verb/options info and description.
- Parameters
-
verb | The Verb for which the help text should be rendered. |
programName | Executable's name to use in the usage text. |
consoleWidth | The console width used to calculate properly formatted and spaced line returns. |
leftSpace | Amount of spaces for any non-heading text in the Verb and Option sections. |
innerSpace | Amount of spaces between the Verb and Option and their description. |
addVerbs | Toggle to include or exclude the Verb section. |
- Returns
- The complete help text as a string.
It is recommended to subtract 1 from the console's max width to prevent weird and unexpected line returns in some command prompts.
◆ GetOptionDetailsPart()
static string NibblePoker.Library.Arguments.HelpText.GetOptionDetailsPart |
( |
Option |
option, |
|
|
uint |
shortOptionSpace = 0 , |
|
|
bool |
addValueToShort = false |
|
) |
| |
|
inlinestatic |
Processes a given Option and returns the details part.
- Parameters
-
option | The Option to process. |
shortOptionSpace | Amount of spaces used by short options in other lines, must include the inner comma and space. |
addValueToShort | Add the value's name part to both the short version if both short and long options are available. |
- Returns
- The formatted text as a string.
◆ GetOptionsDetails()
static string NibblePoker.Library.Arguments.HelpText.GetOptionsDetails |
( |
Verb |
verb, |
|
|
uint |
consoleWidth = 80 , |
|
|
uint |
leftSpace = 2 , |
|
|
uint |
innerSpace = 2 , |
|
|
bool |
addValueToShort = false |
|
) |
| |
|
inlinestatic |
Processes a given Verb to get the associated Options' details text in POSIX format.
- Parameters
-
verb | The Verb for which the help text should be rendered. |
consoleWidth | The console width used to calculate properly formatted and spaced line returns. |
leftSpace | Amount of spaces for any non-heading text. |
innerSpace | Amount of spaces between the Option and their description. |
addValueToShort | Toggle to add the value's name part to both the short version if both short and long Options are available. |
- Returns
- The Options' details as a single string with line returns.
It is recommended to subtract 1 from the console's max width to prevent weird and unexpected line returns in some command prompts.
◆ GetOptionsDetailsLines()
static List< string > NibblePoker.Library.Arguments.HelpText.GetOptionsDetailsLines |
( |
Verb |
verb, |
|
|
uint |
consoleWidth = 80 , |
|
|
uint |
leftSpace = 2 , |
|
|
uint |
innerSpace = 2 , |
|
|
bool |
addValueToShort = false |
|
) |
| |
|
inlinestatic |
Processes a given Verb to get the associated Options' details text in POSIX format as a list.
- Parameters
-
verb | The Verb for which the help text should be rendered. |
consoleWidth | The console width used to calculate properly formatted and spaced line returns. |
leftSpace | Amount of spaces for any non-heading text. |
innerSpace | Amount of spaces between the Option and their description. |
addValueToShort | Add the value's name part to both the short version if both short and long options are available. |
- Returns
- The Options' details as a list of strings.
It is recommended to subtract 1 from the console's max width to prevent weird and unexpected line returns in some command prompts.
◆ GetOptionUsagePart()
static string NibblePoker.Library.Arguments.HelpText.GetOptionUsagePart |
( |
Option |
option | ) |
|
|
inlinestatic |
Processes a given Option and returns the usage part in POSIX format.
- Parameters
-
- Returns
- The formatted text as a string.
◆ GetUsageLines()
static List< string > NibblePoker.Library.Arguments.HelpText.GetUsageLines |
( |
Verb |
verb, |
|
|
string |
programName, |
|
|
uint |
consoleWidth = 80 , |
|
|
bool |
addVerbs = true |
|
) |
| |
|
inlinestatic |
Processes a given Verb to get the associated usage text in POSIX format as a list of lines.
- Parameters
-
verb | The Verb for which the help text should be rendered. |
programName | Executable's name to use. |
consoleWidth | The console width used to calculate properly formatted and spaced line returns. |
addVerbs | Toggle to include or exclude the Verb from the output. |
- Returns
- The formatted lines as a list.
It is recommended to subtract 1 from the console's max width to prevent weird and unexpected line returns in some command prompts.
◆ GetUsageString()
static string NibblePoker.Library.Arguments.HelpText.GetUsageString |
( |
Verb |
verb, |
|
|
string |
programName, |
|
|
uint |
consoleWidth = 80 , |
|
|
bool |
addVerbs = true |
|
) |
| |
|
inlinestatic |
Processes a given Verb to get the associated usage text in POSIX format.
- Parameters
-
verb | The Verb for which the help text should be rendered. |
programName | Executable's name to use. |
consoleWidth | The console width used to calculate properly formatted and spaced line returns. |
addVerbs | Toggle to include or exclude the Verb from the output. |
- Returns
- The formatted lines as a string with line returns.
It is recommended to subtract 1 from the console's max width to prevent weird and unexpected line returns in some command prompts.
◆ GetVerbsDetails()
static string NibblePoker.Library.Arguments.HelpText.GetVerbsDetails |
( |
Verb |
verb, |
|
|
uint |
consoleWidth = 80 , |
|
|
uint |
leftSpace = 2 , |
|
|
uint |
innerSpace = 2 |
|
) |
| |
|
inlinestatic |
Retrieves the sub-Verbs's details section for the given Verbs.
- Parameters
-
verb | The Verbs for which the help text should be rendered. |
consoleWidth | The console width used to calculate properly formatted and spaced line returns. |
leftSpace | Amount of spaces for any non-heading text. |
innerSpace | Amount of spaces between the Verbs and their description. |
- Returns
- The Verb' sub-Verbs' details as a single string with line returns.
It is recommended to subtract 1 from the console's max width to prevent weird and unexpected line returns in some command prompts.
◆ SplitToMultiline()
static string NibblePoker.Library.Arguments.HelpText.SplitToMultiline |
( |
string |
inputText, |
|
|
int |
maxLineLength, |
|
|
string |
sequentialPrefix |
|
) |
| |
|
inlinestatic |
Splits a given text in a series of lines with a given line prefix that fit in a given width.
- Parameters
-
inputText | Text to split. |
maxLineLength | Maximum line length. |
sequentialPrefix | Prefix text to use for any split line. |
- Returns
- The split text as a single string.
The documentation for this class was generated from the following file:
- /github/workspace/NibblePoker.Library.Arguments/HelpText.cs