RoadmapShopEvents
Skip to main content

Home > @rushstack/ts-command-line > CommandLineParameterProvider > defineCommandLineRemainder

CommandLineParameterProvider.defineCommandLineRemainder() method

Defines a rule that captures any remaining command line arguments after the recognized portion.

Signature:
defineCommandLineRemainder(definition: ICommandLineRemainderDefinition): CommandLineRemainder;

Parameters

ParameterTypeDescription
definitionICommandLineRemainderDefinition
Returns:

CommandLineRemainder

Remarks

This feature is useful for commands that pass their arguments along to an external tool, relying on that tool to perform validation. (It could also be used to parse parameters without any validation or documentation, but that is not recommended.)

Example of capturing the remainder after an optional flag parameter.

example-tool --my-flag this is the remainder

In the "--help" documentation, the remainder rule will be represented as "...".