Support parsing multiple usage blocks, and add the UsageInstance class, which provides access to all these usage examples in the help. For example after parsing the text below, we would have 4 UsageInstances. The instances are provided on Command.usage:
Usage:
shell [options] -e string
execute string in V8
shell [options] file1 file2 ... filek
run JavaScript scripts in file1, file2, ..., filek
shell [options]
shell [options] --shell [file1 file2 ... filek]
run an interactive JavaScript shell
Add flag and positional de-duplication, ensuring we don't have duplicate options in the final Command
Add the max_length parameter to parse_help: If the input text has more than this many lines, no attempt will be made to parse the file (as it's too large, will likely take a long time, and there's probably an underlying problem if this has happened). In this case, an empty Command will be returned
Enforce that Positionals always have at least 2-character names, in the parser
Enforce that a Positional must have a description, in the parser
Internal Changes
Rewrite of both the flag and usage parser
Added more customizable indent tokens, meaning we no longer need the customIndentedBlock
Refactor both the usage parser and the flag parser into subclasses of IndentParserMixin, which provides useful common parsing logic that relates to indentation
Use MatchFirst instead of MatchLongest logic in most places in the parser. This should result in more consistent behaviour.
Add typeHLA.js text, which is derived from the bwa-kit container.
Fixes
Always strip out newlines from the WDL description
User-Facing Changes
UsageInstance
class, which provides access to all these usage examples in the help. For example after parsing the text below, we would have 4UsageInstance
s. The instances are provided onCommand.usage
:Command
max_length
parameter toparse_help
: If the input text has more than this many lines, no attempt will be made to parse the file (as it's too large, will likely take a long time, and there's probably an underlying problem if this has happened). In this case, an empty Command will be returnedPositional
s always have at least 2-character names, in the parserPositional
must have a description, in the parserInternal Changes
customIndentedBlock
IndentParserMixin
, which provides useful common parsing logic that relates to indentationMatchFirst
instead ofMatchLongest
logic in most places in the parser. This should result in more consistent behaviour.typeHLA.js
text, which is derived from thebwa-kit
container.Fixes