Skip to content

Commit 82817f3

Browse files
committed
Update projects to use new ts-command-line API
1 parent 0ce33aa commit 82817f3

File tree

7 files changed

+22
-20
lines changed

7 files changed

+22
-20
lines changed

apps/api-documenter/src/cli/BaseAction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ export abstract class BaseAction extends CommandLineAction {
2222
this._inputFolderParameter = this.defineStringParameter({
2323
parameterLongName: '--input-folder',
2424
parameterShortName: '-i',
25-
key: 'FOLDER1',
25+
argumentName: 'FOLDER1',
2626
description: `Specifies the input folder containing the *.api.json files to be processed.`
2727
+ ` If omitted, the default is "./input"`
2828
});
2929

3030
this._outputFolderParameter = this.defineStringParameter({
3131
parameterLongName: '--output-folder',
3232
parameterShortName: '-o',
33-
key: 'FOLDER2',
33+
argumentName: 'FOLDER2',
3434
description: `Specifies the output folder where the documentation will be written.`
3535
+ ` ANY EXISTING CONTENTS WILL BE DELETED!`
3636
+ ` If omitted, the default is "./${this.options.actionVerb}"`

apps/api-extractor/src/cli/RunAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class RunAction extends CommandLineAction {
3838
this._configFileParameter = this.defineStringParameter({
3939
parameterLongName: '--config',
4040
parameterShortName: '-c',
41-
key: 'FILE',
41+
argumentName: 'FILE',
4242
description: `Use the specified ${AE_CONFIG_FILENAME} file path, rather than guessing its location`
4343
});
4444
this._localParameter = this.defineFlagParameter({

apps/rush-lib/src/cli/actions/BaseInstallAction.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export abstract class BaseInstallAction extends BaseRushAction {
1111
protected onDefineParameters(): void {
1212
this._authenticationTokensParameter = this.defineStringListParameter({
1313
parameterLongName: '--auth-token',
14+
argumentName: 'TOKEN',
1415
description: '(EXPERIMENTAL) List authentication tokens required to install packages. These must be in the '
1516
+ 'format of lines of a .npmrc file. They will be appended to the .npmrc file used during package installation.'
1617
});

apps/rush-lib/src/cli/actions/ChangeAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default class ChangeAction extends BaseRushAction {
8888
this._targetBranchParameter = this.defineStringParameter({
8989
parameterLongName: '--target-branch',
9090
parameterShortName: '-b',
91-
key: 'BRANCH',
91+
argumentName: 'BRANCH',
9292
description: 'If this parameter is specified, compare current branch with the target branch to get changes. ' +
9393
'If this parameter is not specified, the current branch is compared against the "master" branch.'
9494
});

apps/rush-lib/src/cli/actions/CustomRushAction.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class CustomRushAction extends BaseRushAction {
132132
this._parallelismParameter = this.defineStringParameter({
133133
parameterLongName: '--parallelism',
134134
parameterShortName: '-p',
135-
key: 'COUNT',
135+
argumentName: 'COUNT',
136136
description: 'Specify the number of concurrent build processes'
137137
+ ' The value "max" can be specified to indicate the number of CPU cores.'
138138
+ ' If this parameter omitted, the default value depends on the operating system and number of CPU cores.'
@@ -141,13 +141,13 @@ export class CustomRushAction extends BaseRushAction {
141141
this._toFlag = this.defineStringListParameter({
142142
parameterLongName: '--to',
143143
parameterShortName: '-t',
144-
key: 'PROJECT1',
144+
argumentName: 'PROJECT1',
145145
description: 'Run command in the specified project and all of its dependencies'
146146
});
147147
this._fromFlag = this.defineStringListParameter({
148148
parameterLongName: '--from',
149149
parameterShortName: '-f',
150-
key: 'PROJECT2',
150+
argumentName: 'PROJECT2',
151151
description: 'Run command in all projects that directly or indirectly depend on the specified project'
152152
});
153153
this._verboseParameter = this.defineFlagParameter({
@@ -158,7 +158,7 @@ export class CustomRushAction extends BaseRushAction {
158158
if (this.options.actionVerb === 'build') {
159159
this._changedProjectsOnly = this.defineFlagParameter({
160160
parameterLongName: '--changed-projects-only',
161-
parameterShortName: '-cpo',
161+
parameterShortName: '-o',
162162
description: 'If specified, the incremental build will only rebuild projects that have changed, '
163163
+ 'but not any projects that directly or indirectly depend on the changed package.'
164164
});
@@ -179,7 +179,7 @@ export class CustomRushAction extends BaseRushAction {
179179
parameterLongName: longName,
180180
description: customOption.optionDefinition.description,
181181
defaultValue: customOption.optionDefinition.defaultValue,
182-
options: customOption.optionDefinition.enumValues.map((enumValue: ICustomEnumValue) => {
182+
alternatives: customOption.optionDefinition.enumValues.map((enumValue: ICustomEnumValue) => {
183183
return enumValue.name;
184184
})
185185
});

apps/rush-lib/src/cli/actions/PublishAction.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default class PublishAction extends BaseRushAction {
6868
this._targetBranch = this.defineStringParameter({
6969
parameterLongName: '--target-branch',
7070
parameterShortName: '-b',
71-
key: 'BRANCH',
71+
argumentName: 'BRANCH',
7272
description:
7373
'If this flag is specified, applied changes and deleted change requests will be' +
7474
'committed and merged into the target branch.'
@@ -93,22 +93,22 @@ export default class PublishAction extends BaseRushAction {
9393
this._registryUrl = this.defineStringParameter({
9494
parameterLongName: '--registry',
9595
parameterShortName: '-r',
96-
key: 'REGISTRY',
96+
argumentName: 'REGISTRY',
9797
description:
9898
`Publishes to a specified NPM registry. If this is specified, it will prevent the current commit will not be ` +
9999
'tagged.'
100100
});
101101
this._npmAuthToken = this.defineStringParameter({
102102
parameterLongName: '--npm-auth-token',
103103
parameterShortName: '-n',
104-
key: 'TOKEN',
104+
argumentName: 'TOKEN',
105105
description:
106106
'Provide the default scope NPM auth token to be passed into npm publish for global package publishing.'
107107
});
108108
this._npmTag = this.defineStringParameter({
109109
parameterLongName: '--tag',
110110
parameterShortName: '-t',
111-
key: 'TAG',
111+
argumentName: 'TAG',
112112
description:
113113
`The tag option to pass to npm publish. By default NPM will publish using the 'latest' tag, even if ` +
114114
`the package is older than the current latest, so in publishing workflows for older releases, providing ` +
@@ -124,7 +124,7 @@ export default class PublishAction extends BaseRushAction {
124124
});
125125
this._releaseFolder = this.defineStringParameter({
126126
parameterLongName: '--release-folder',
127-
key: 'RELEASEFOLDER',
127+
argumentName: 'FOLDER',
128128
description:
129129
`This parameter is used with --pack parameter to provide customized location for the tarballs instead of ` +
130130
`the default value. `
@@ -139,20 +139,18 @@ export default class PublishAction extends BaseRushAction {
139139
});
140140
this._versionPolicy = this.defineStringParameter({
141141
parameterLongName: '--version-policy',
142-
parameterShortName: '-vp',
143-
key: 'VERSIONPOLICY',
142+
argumentName: 'POLICY',
144143
description: 'Version policy name. Only projects with this version policy will be published if used ' +
145144
'with --include-all.'
146145
});
147146
this._prereleaseName = this.defineStringParameter({
148147
parameterLongName: '--prerelease-name',
149-
parameterShortName: '-pn',
150-
key: 'NAME',
148+
argumentName: 'NAME',
151149
description: 'Bump up to a prerelease version with the provided prerelease name. Cannot be used with --suffix'
152150
});
153151
this._suffix = this.defineStringParameter({
154152
parameterLongName: '--suffix',
155-
key: 'SUFFIX',
153+
argumentName: 'SUFFIX',
156154
description: 'Append a suffix to all changed versions. Cannot be used with --prerelease-name.'
157155
});
158156
this._force = this.defineFlagParameter({

apps/rush-lib/src/cli/actions/VersionAction.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default class VersionAction extends BaseRushAction {
4242
this._targetBranch = this.defineStringParameter({
4343
parameterLongName: '--target-branch',
4444
parameterShortName: '-b',
45-
key: 'BRANCH',
45+
argumentName: 'BRANCH',
4646
description:
4747
'If this flag is specified, changes will be committed and merged into the target branch.'
4848
});
@@ -62,16 +62,19 @@ export default class VersionAction extends BaseRushAction {
6262
this._versionPolicy = this.defineStringParameter({
6363
parameterLongName: '--version-policy',
6464
parameterShortName: '-p',
65+
argumentName: 'POLICY',
6566
description: 'The name of the version policy'
6667
});
6768
this._overwriteBump = this.defineStringParameter({
6869
parameterLongName: '--override-bump',
70+
argumentName: 'POLICY',
6971
description: 'Overrides the bump type in the version-policy.json for the specified version policy.' +
7072
'Valid values include: prerelease, patch, preminor, minor, major. ' +
7173
'This setting only works for lock-step version policy in bump action.'
7274
});
7375
this._prereleaseIdentifier = this.defineStringParameter({
7476
parameterLongName: '--override-prerelease-id',
77+
argumentName: 'POLICY',
7578
description: 'Overrides the prerelease identifier in the version value of version-policy.json ' +
7679
'for the specified version policy. ' +
7780
'This setting only works for lock-step version policy in bump action.'

0 commit comments

Comments
 (0)