Parsers and Combinators
cmd-ts can help you build a full command line application, with nested commands, options, arguments, and whatever you want. One of the secret sauces baked into cmd-ts is the ability to compose parsers.
Argument Parser
An argument parser is a simple struct with a parse function and an optional register function.
cmd-ts is shipped with a couple of parsers and combinators to help you build your dream command-line app. subcommands are built using nested commands. Every command is built with flag, option and positional arguments. Here is a short parser description:
- positionaland- restPositionalsto read arguments by position
- optionand- multioptionto read binary- --key valuearguments
- flagand- multiflagto read unary- --keyarguments
- commandto compose multiple arguments into a command line app
- subcommandsto compose multiple command line apps into one command line app
- binaryto make a command line app a UNIX-executable-ready command