cli::addVerb
addVerb(parser: CliParser, name: String, closure)
Parameter | Type | Description |
---|---|---|
parser | CliParser | The parser to add it to |
name | String | The name of the verb |
closure | * | A handler for populating the verb's own CliParser |
Adds a verb to the given parser. Usage example: ./main.elk some-verb [flags] [arguments]
Returns
(*) The parser that was given.
Example
elk
parser | cli::addVerb some-verb => someVerbParser: {
someVerbParser
| cli::addFlag({
"identifier": "some-flag",
"short": "s",
})
| cli::addFlag({
"identifier": "another-flag",
"short": "a",
})
}
parser | cli::addVerb some-verb => someVerbParser: {
someVerbParser
| cli::addFlag({
"identifier": "some-flag",
"short": "s",
})
| cli::addFlag({
"identifier": "another-flag",
"short": "a",
})
}