Skip to content

Commit

Permalink
fix(cli): cli capitalisation (#3539)
Browse files Browse the repository at this point in the history
  • Loading branch information
DevanceJ committed Apr 12, 2024
1 parent d3d47b2 commit fc9af7c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/api/cli/src/electron-forge-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import workingDir from './util/working-dir';
(async () => {
let dir = process.cwd();
program
.version((await fs.readJson(path.resolve(__dirname, '../package.json'))).version)
.version((await fs.readJson(path.resolve(__dirname, '../package.json'))).version, '-V, --version', 'Output the current version')
.helpOption('-h, --help', 'Output usage information')
.arguments('[name]')
.action((name) => {
dir = workingDir(dir, name, false);
Expand Down
3 changes: 2 additions & 1 deletion packages/api/cli/src/electron-forge-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import workingDir from './util/working-dir';
(async () => {
let dir = process.cwd();
program
.version((await fs.readJson(path.resolve(__dirname, '../package.json'))).version)
.version((await fs.readJson(path.resolve(__dirname, '../package.json'))).version, '-V, --version', 'Output the current version')
.arguments('[name]')
.option('-t, --template [name]', 'Name of the Forge template to use')
.option('-c, --copy-ci-files', 'Whether to copy the templated CI files (defaults to false)', false)
.option('-f, --force', 'Whether to overwrite an existing directory (defaults to false)', false)
.helpOption('-h, --help', 'Output usage information')
.action((name) => {
dir = workingDir(dir, name, false);
})
Expand Down
3 changes: 2 additions & 1 deletion packages/api/cli/src/electron-forge-make.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import workingDir from './util/working-dir';
export async function getMakeOptions(): Promise<MakeOptions> {
let dir = process.cwd();
program
.version((await fs.readJson(path.resolve(__dirname, '../package.json'))).version)
.version((await fs.readJson(path.resolve(__dirname, '../package.json'))).version, '-V, --version', 'Output the current version')
.arguments('[cwd]')
.option('--skip-package', 'Assume the app is already packaged')
.option('-a, --arch [arch]', 'Target architecture')
.option('-p, --platform [platform]', 'Target build platform')
.option('--targets [targets]', 'Override your make targets for this run')
.helpOption('-h, --help', 'Output usage information')
.allowUnknownOption(true)
.action((cwd) => {
dir = workingDir(dir, cwd);
Expand Down
3 changes: 2 additions & 1 deletion packages/api/cli/src/electron-forge-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ import workingDir from './util/working-dir';
(async () => {
let dir: string = process.cwd();
program
.version((await fs.readJson(path.resolve(__dirname, '../package.json'))).version)
.version((await fs.readJson(path.resolve(__dirname, '../package.json'))).version, '-V, --version', 'Output the current version')
.arguments('[cwd]')
.option('-a, --arch [arch]', 'Target architecture')
.option('-p, --platform [platform]', 'Target build platform')
.helpOption('-h, --help', 'Output usage information')
.action((cwd) => {
dir = workingDir(dir, cwd);
})
Expand Down
3 changes: 2 additions & 1 deletion packages/api/cli/src/electron-forge-publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ import workingDir from './util/working-dir';
(async () => {
let dir = process.cwd();
program
.version((await fs.readJson(path.resolve(__dirname, '../package.json'))).version)
.version((await fs.readJson(path.resolve(__dirname, '../package.json'))).version, '-V, --version', 'Output the current version')
.arguments('[cwd]')
.option('--target [target[,target...]]', 'The comma-separated deployment targets, defaults to "github"')
.option('--dry-run', "Triggers a publish dry run which saves state and doesn't upload anything")
.option('--from-dry-run', 'Attempts to publish artifacts from the last saved dry run')
.helpOption('-h, --help', 'Output usage information')
.allowUnknownOption(true)
.action((cwd) => {
dir = workingDir(dir, cwd);
Expand Down
3 changes: 2 additions & 1 deletion packages/api/cli/src/electron-forge-start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ import workingDir from './util/working-dir';

let dir = process.cwd();
program
.version((await fs.readJson(path.resolve(__dirname, '../package.json'))).version)
.version((await fs.readJson(path.resolve(__dirname, '../package.json'))).version, '-V, --version', 'Output the current version')
.arguments('[cwd]')
.option('-p, --app-path <path>', "Override the path to the Electron app to launch (defaults to '.')")
.option('-l, --enable-logging', 'Enable advanced logging. This will log internal Electron things')
.option('-n, --run-as-node', 'Run the Electron app as a Node.JS script')
.option('--vscode', 'Used to enable arg transformation for debugging Electron through VSCode. Do not use yourself.')
.option('-i, --inspect-electron', 'Triggers inspect mode on Electron to allow debugging the main process. Electron >1.7 only')
.option('--inspect-brk-electron', 'Triggers inspect-brk mode on Electron to allow debugging the main process. Electron >1.7 only')
.helpOption('-h, --help', 'Output usage information')
.action((cwd) => {
dir = workingDir(dir, cwd);
})
Expand Down
3 changes: 2 additions & 1 deletion packages/api/cli/src/electron-forge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ program.executeSubCommand = (argv: string[], args: string[], unknown: string[])
};

program
.version(metadata.version)
.version(metadata.version, '-V, --version', 'Output the current version')
.option('--verbose', 'Enables verbose mode')
.helpOption('-h, --help', 'Output usage information')
.command('init', 'Initialize a new Electron application')
.command('import', 'Attempts to navigate you through the process of importing an existing project to "electron-forge"')
.command('start', 'Start the current Electron application in development mode')
Expand Down

0 comments on commit fc9af7c

Please sign in to comment.