From eb396811bd1dc11cbee010002517b45cece7f69f Mon Sep 17 00:00:00 2001 From: devance Date: Sun, 17 Mar 2024 22:37:48 +0530 Subject: [PATCH] feat(cli): cli capitalisation --- packages/api/cli/src/electron-forge-import.ts | 3 ++- packages/api/cli/src/electron-forge-init.ts | 3 ++- packages/api/cli/src/electron-forge-make.ts | 3 ++- packages/api/cli/src/electron-forge-package.ts | 3 ++- packages/api/cli/src/electron-forge-publish.ts | 3 ++- packages/api/cli/src/electron-forge-start.ts | 3 ++- packages/api/cli/src/electron-forge.ts | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/api/cli/src/electron-forge-import.ts b/packages/api/cli/src/electron-forge-import.ts index da1eaf499c..5acf0ae0c7 100644 --- a/packages/api/cli/src/electron-forge-import.ts +++ b/packages/api/cli/src/electron-forge-import.ts @@ -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); diff --git a/packages/api/cli/src/electron-forge-init.ts b/packages/api/cli/src/electron-forge-init.ts index 7dd3300f75..4acbc0b5a6 100644 --- a/packages/api/cli/src/electron-forge-init.ts +++ b/packages/api/cli/src/electron-forge-init.ts @@ -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); }) diff --git a/packages/api/cli/src/electron-forge-make.ts b/packages/api/cli/src/electron-forge-make.ts index fae18b763e..56cce2cbcc 100644 --- a/packages/api/cli/src/electron-forge-make.ts +++ b/packages/api/cli/src/electron-forge-make.ts @@ -11,12 +11,13 @@ import workingDir from './util/working-dir'; export async function getMakeOptions(): Promise { 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); diff --git a/packages/api/cli/src/electron-forge-package.ts b/packages/api/cli/src/electron-forge-package.ts index ead2fe2f66..f921493b1c 100644 --- a/packages/api/cli/src/electron-forge-package.ts +++ b/packages/api/cli/src/electron-forge-package.ts @@ -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); }) diff --git a/packages/api/cli/src/electron-forge-publish.ts b/packages/api/cli/src/electron-forge-publish.ts index e3759cb36d..ca808c0f12 100644 --- a/packages/api/cli/src/electron-forge-publish.ts +++ b/packages/api/cli/src/electron-forge-publish.ts @@ -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); diff --git a/packages/api/cli/src/electron-forge-start.ts b/packages/api/cli/src/electron-forge-start.ts index 5e279f4e7f..21191d30f1 100644 --- a/packages/api/cli/src/electron-forge-start.ts +++ b/packages/api/cli/src/electron-forge-start.ts @@ -20,7 +20,7 @@ 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 ', "Override the path to the Electron app to launch (defaults to '.')") .option('-l, --enable-logging', 'Enable advanced logging. This will log internal Electron things') @@ -28,6 +28,7 @@ import workingDir from './util/working-dir'; .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); }) diff --git a/packages/api/cli/src/electron-forge.ts b/packages/api/cli/src/electron-forge.ts index 1f7b6b031e..70afa343ce 100755 --- a/packages/api/cli/src/electron-forge.ts +++ b/packages/api/cli/src/electron-forge.ts @@ -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')