File tree Expand file tree Collapse file tree 4 files changed +30
-0
lines changed
libraries/ts-command-line/src Expand file tree Collapse file tree 4 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,13 @@ class CommandLineParameterProvider {
9191 renderHelpText ( ) : string ;
9292}
9393
94+ // @public
95+ class CommandLineParameterWithArgument < T > extends CommandLineParameter < T > {
96+ // @internal
97+ constructor ( definition : IBaseCommandLineDefinitionWithArgument ) ;
98+ readonly argumentName : string | undefined ;
99+ }
100+
94101// @public
95102class CommandLineParser extends CommandLineParameterProvider {
96103 constructor ( options : ICommandLineParserOptions ) ;
@@ -138,6 +145,11 @@ interface IBaseCommandLineDefinition {
138145 parameterShortName ?: string ;
139146}
140147
148+ // @public
149+ interface IBaseCommandLineDefinitionWithArgument extends IBaseCommandLineDefinition {
150+ argumentName : string ;
151+ }
152+
141153// @public
142154interface ICommandLineActionOptions {
143155 actionVerb : string ;
Original file line number Diff line number Diff line change @@ -23,6 +23,14 @@ export interface IBaseCommandLineDefinition {
2323 description : string ;
2424}
2525
26+ /**
27+ * The common base interface for parameter types that accept an argument.
28+ *
29+ * @remarks
30+ * An argument is an accompanying command-line token, such as "123" in the
31+ * example "--max-count 123".
32+ * @public
33+ */
2634export interface IBaseCommandLineDefinitionWithArgument extends IBaseCommandLineDefinition {
2735 /**
2836 * The name of the argument, which will be shown in the command-line help.
Original file line number Diff line number Diff line change @@ -96,6 +96,14 @@ export abstract class CommandLineParameter<T> {
9696 public abstract get kind ( ) : CommandLineParameterKind ;
9797}
9898
99+ /**
100+ * The common base class for parameters types that receive an argument.
101+ *
102+ * @remarks
103+ * An argument is an accompanying command-line token, such as "123" in the
104+ * example "--max-count 123".
105+ * @public
106+ */
99107export abstract class CommandLineParameterWithArgument < T > extends CommandLineParameter < T > {
100108 private static _invalidArgumentNameRegExp : RegExp = / [ ^ A - Z _ 0 - 9 ] / ;
101109
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export {
1414
1515export {
1616 IBaseCommandLineDefinition ,
17+ IBaseCommandLineDefinitionWithArgument ,
1718 ICommandLineFlagDefinition ,
1819 ICommandLineStringDefinition ,
1920 ICommandLineStringListDefinition ,
@@ -24,6 +25,7 @@ export {
2425export {
2526 CommandLineParameterKind ,
2627 CommandLineParameter ,
28+ CommandLineParameterWithArgument ,
2729 CommandLineStringParameter ,
2830 CommandLineStringListParameter ,
2931 CommandLineFlagParameter ,
You can’t perform that action at this time.
0 commit comments