Skip to content

Commit

Permalink
std: Document the cli flag and argument objects
Browse files Browse the repository at this point in the history
  • Loading branch information
PaddiM8 committed Nov 12, 2023
1 parent 6db9516 commit 330929e
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions src/Std/Cli.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,21 @@ public static RuntimeCliParser SetAction(RuntimeCliParser parser, Action<Runtime
/// "long": "test-flag", # A long version of the flag (default: nil)
/// "description": "Test flag", # A description of the flag (default: nil)
/// "format": "hh:mm", # An example of how to format the value given to the flag (default: nil)
/// "expects-value": true, # Whether or not the flag expects a value (default: false)
/// "required": true, # Whether or not the flag is required (default: false)
/// })
///
/// # Default values for the flag object
/// {
/// "identifier": nil, # Identifier used to later get the value of the flag
/// "short": nil, # A short version of the flag (a single letter)
/// "long": nil, # A long version of the flag
/// "description": nil, # A description of the flag
/// "format": nil, # An example of how to format the value given to the flag
/// "required": false, # Whether or not the flag is required
/// "valueKind": "none", # "none", "path", "directory" or "text"
/// "completionHandler": nil, # A function used for custom completions
/// "allowCustomCompletionHints": false, # Whether or not hints should be displayed for custom completions
/// }
/// </example>
[ElkFunction("addFlag")]
public static RuntimeObject AddFlag(RuntimeCliParser parser, RuntimeDictionary flag)
Expand Down Expand Up @@ -108,11 +120,22 @@ public static RuntimeObject AddFlag(RuntimeCliParser parser, RuntimeDictionary f
/// <returns>The parser that was given.</returns>
/// <example>
/// parser | cli::addArgument({
/// "identifier": "test-flag", # Identifier used to later get the value of the flag (default: nil)
/// "description": "Some description", # A description of the flag (default: nil)
/// "required": true, # Whether or not the flag is required (default: false)
/// "variadic": true, # Whether or not the argument may consist of several tokens (default: false)
/// "identifier": "test-argument",
/// "description": "Some description",
/// "required": true,
/// "variadic": true,
/// })
///
/// # Default values for the argument object
/// {
/// "identifier": nil, # Identifier used to later get the value of the argument
/// "description": nil, # A description of the argument
/// "required": false, # Whether or not the argument is required
/// "variadic": false, # Whether or not the argument may consist of several tokens
/// "valueKind": "none", # "none", "path", "directory" or "text"
/// "completionHandler": nil, # A function used for custom completions
/// "allowCustomCompletionHints": false, # Whether or not hints should be displayed for custom completions
/// }
/// </example>
[ElkFunction("addArgument")]
public static RuntimeObject AddArgument(RuntimeCliParser parser, RuntimeDictionary argument)
Expand Down

0 comments on commit 330929e

Please sign in to comment.