Skip to content

Commit

Permalink
fix: list all valid targets in documentation for --target (#766)
Browse files Browse the repository at this point in the history
Fixes: #763
  • Loading branch information
joaomoreno committed Aug 19, 2022
1 parent 27fad23 commit 0940626
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/main.ts
@@ -1,6 +1,6 @@
import program from 'commander';
import leven from 'leven';
import { packageCommand, ls } from './package';
import { packageCommand, ls, Targets } from './package';
import { publish, unpublish } from './publish';
import { show } from './show';
import { search } from './search';
Expand Down Expand Up @@ -55,6 +55,8 @@ function main(task: Promise<any>): void {
});
}

const ValidTargets = [...Targets].join(', ');

module.exports = function (argv: string[]): void {
program.version(pkg.version).usage('<command>');

Expand All @@ -81,7 +83,7 @@ module.exports = function (argv: string[]): void {
.command('package [version]')
.description('Packages an extension')
.option('-o, --out <path>', 'Output .vsix extension file to <path> location (defaults to <name>-<version>.vsix)')
.option('-t, --target <target>', 'Target architecture')
.option('-t, --target <target>', `Target architecture. Valid targets: ${ValidTargets}`)
.option('-m, --message <commit message>', 'Commit message used when calling `npm version`.')
.option(
'--no-git-tag-version',
Expand Down Expand Up @@ -167,7 +169,7 @@ module.exports = function (argv: string[]): void {
'Personal Access Token (defaults to VSCE_PAT environment variable)',
process.env['VSCE_PAT']
)
.option('-t, --target <targets...>', 'Target architectures')
.option('-t, --target <targets...>', `Target architectures. Valid targets: ${ValidTargets}`)
.option('-m, --message <commit message>', 'Commit message used when calling `npm version`.')
.option(
'--no-git-tag-version',
Expand Down
2 changes: 1 addition & 1 deletion src/package.ts
Expand Up @@ -350,7 +350,7 @@ export async function versionBump(options: IVersionBumpOptions): Promise<void> {
}
}

const Targets = new Set([
export const Targets = new Set([
'win32-x64',
'win32-ia32',
'win32-arm64',
Expand Down

0 comments on commit 0940626

Please sign in to comment.