Appends options (for profiles, global options like help, etc.) automatically
The original command definition tree to "prepare"
Option definitions sourced from base profile
A copy of the original that has been prepared
Appends items which should be passed on to later nodes
The original command definition tree to "prepare"
Check if the current node should be ignored. The name of the node is checked agaisnt the specification in the pass on parameters.
The command definition node
The names to ignore
A command definition node can indicate any arbitrary field be "passed on" to it's children. The intention is to provide convienence for the coder of definition document, when they want to apply the same attributes (such as reading from stdin OR which profiles are required) to all of its decedents.
the original command document
the current set of attributes/fields being "passed on" - if a "pass on" specification is found in a child document, it overwrites the parents (takes precedence)
A copy of the original with all "passed on" fields.
Perform preliminary (or post prepared) basic validation of the command definition tree. Checks to ensure that absoultely necessary fields are populated and invalid combos are not present.
Note: The root command is a bit of a special case, and is immune to some validation - we can't have a name associated because that would cause an extra segment added in yargs.
The current command definition in the tree
the current set of definitions we've traversed - for diagnostics
Perform basic option operand validation. Ensure that the option operands are valid and well formed.
The command definition containing options to be validated
Perform basic positional operand validation. Ensure that the positional operands are valid and well formed.
The command definition containing positionals to be validated
If the "passOn" specification does not indicate a value, we will extract the value/trait from the parent and populate the "passOn" value. This allows parents to pass on their own properties/traits.
the full definition tree
Prepare the command definition and apply any pass on traits to children. After a definition has been prepared, it should be considered final.
The original command definition tree to "prepare"
An optional base profile to add to command definitions
A copy of the original that has been prepared
If optional fields have not been populated in the original definition, ensure they are set to the appropriate defaults.
the definition tree to set the default values
Perform preliminary (or post-preparation) basic validation of the command definition tree. Checks to ensure that absoultely necessary fields are populated and invalid combos are not present.
full tree of command definitions to validate
Generated using TypeDoc
Command preparer provides static utilities to ensure that command definitions are suitable for Imperative definition.