@@ -49,20 +49,14 @@ export abstract class CommandLineParameterProvider {
4949 this . _keys = new Map < string , string > ( ) ;
5050 }
5151
52- /**
53- * The child class should implement this hook to define its command-line parameters,
54- * e.g. by calling defineFlagParameter().
55- */
56- protected abstract onDefineParameters ( ) : void ;
57-
5852 /**
5953 * Defines a command-line switch whose boolean value is true if the switch is provided,
6054 * and false otherwise.
6155 *
6256 * @remarks
6357 * Example: example-tool --debug
6458 */
65- protected defineFlagParameter ( definition : ICommandLineFlagDefinition ) : CommandLineFlagParameter {
59+ public defineFlagParameter ( definition : ICommandLineFlagDefinition ) : CommandLineFlagParameter {
6660 return this . _createParameter ( definition , {
6761 action : 'storeTrue'
6862 } ) as CommandLineFlagParameter ;
@@ -74,7 +68,7 @@ export abstract class CommandLineParameterProvider {
7468 * @remarks
7569 * Example: example-tool --message "Hello, world!"
7670 */
77- protected defineStringParameter ( definition : ICommandLineStringDefinition ) : CommandLineStringParameter {
71+ public defineStringParameter ( definition : ICommandLineStringDefinition ) : CommandLineStringParameter {
7872 return this . _createParameter ( definition , undefined , definition . key ) as CommandLineStringParameter ;
7973 }
8074
@@ -84,7 +78,7 @@ export abstract class CommandLineParameterProvider {
8478 * @remarks
8579 * Example: example-tool --add file1.txt --add file2.txt --add file3.txt
8680 */
87- protected defineStringListParameter ( definition : ICommandLineStringListDefinition ) : CommandLineStringListParameter {
81+ public defineStringListParameter ( definition : ICommandLineStringListDefinition ) : CommandLineStringListParameter {
8882 return this . _createParameter ( definition , {
8983 action : 'append'
9084 } , definition . key ) as CommandLineStringListParameter ;
@@ -96,7 +90,7 @@ export abstract class CommandLineParameterProvider {
9690 * @remarks
9791 * Example: example-tool l --max-attempts 5
9892 */
99- protected defineIntegerParameter ( definition : ICommandLineIntegerDefinition ) : CommandLineIntegerParameter {
93+ public defineIntegerParameter ( definition : ICommandLineIntegerDefinition ) : CommandLineIntegerParameter {
10094 return this . _createParameter ( definition , {
10195 type : 'int'
10296 } , definition . key ) as CommandLineIntegerParameter ;
@@ -109,7 +103,7 @@ export abstract class CommandLineParameterProvider {
109103 * @remarks
110104 * Example: example-tool --log-level warn
111105 */
112- protected defineChoiceParameter ( definition : ICommandLineChoiceDefinition ) : CommandLineChoiceParameter {
106+ public defineChoiceParameter ( definition : ICommandLineChoiceDefinition ) : CommandLineChoiceParameter {
113107 if ( ! definition . options ) {
114108 throw new Error ( `When defining an option parameter, the options array must be defined.` ) ;
115109 }
@@ -123,6 +117,12 @@ export abstract class CommandLineParameterProvider {
123117 } ) as CommandLineChoiceParameter ;
124118 }
125119
120+ /**
121+ * The child class should implement this hook to define its command-line parameters,
122+ * e.g. by calling defineFlagParameter().
123+ */
124+ protected abstract onDefineParameters ( ) : void ;
125+
126126 /** @internal */
127127 protected _processParsedData ( data : ICommandLineParserData ) : void {
128128 // Fill in the values for the parameters
0 commit comments