Skip to content

Commit

Permalink
fix: fix still more --json option overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
serhalp committed Jan 21, 2025
1 parent d0bf048 commit 5b9ab21
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/commands/deploy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ Support for package.json's main field, and intrinsic index.js entrypoints are co
)
.option('-O, --open', 'Open site after deploy', false)
.option('-m, --message <message>', 'A short message to include in the deploy log')
// The BaseCommand defines an `--auth` option which is hidden from the help by default
.addHelpOption(new Option('-a, --auth <token>', 'Netlify auth token to deploy with'))
.option('-s, --site <name-or-id>', 'A site name or ID to deploy to', env.NETLIFY_SITE_ID)
.option('--json', 'Output deployment data as JSON')
// The BaseCommand defines a `--json` option which is hidden from the help by default
.addHelpOption(new Option('--json', 'Output deployment data as JSON'))
.option('--timeout <number>', 'Timeout to wait for deployment to finish', (value) => Number.parseInt(value))
.addOption(
new Option('--trigger', 'Trigger a new build of your site on Netlify without uploading local files').conflicts(
Expand Down
3 changes: 2 additions & 1 deletion src/commands/env/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export const createEnvCommand = (program: BaseCommand) => {
normalizeContext,
'dev',
)
.option('--json', 'Output environment variables as JSON')
// The BaseCommand defines a `--json` option which is hidden from the help by default
.addHelpOption(new Option('--json', 'Output environment variables as JSON'))
.addOption(new Option('--plain', 'Output environment variables as plaintext').conflicts('json'))
.addOption(
new Option('-s, --scope <scope>', 'Specify a scope')
Expand Down
3 changes: 2 additions & 1 deletion src/commands/functions/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ Helpful for making sure that you have formatted your functions correctly
NOT the same as listing the functions that have been deployed. For that info you need to go to your Netlify deploy log.`,
)
.option('-f, --functions <dir>', 'Specify a functions directory to list')
.option('--json', 'Output function data as JSON')
// The BaseCommand defines a `--json` option which is hidden from the help by default
.addHelpOption(new Option('--json', 'Output function data as JSON'))
.hook('preAction', requiresSiteInfo)
.action(async (options: OptionValues, command: BaseCommand) => {
const { functionsList } = await import('./functions-list.js')
Expand Down
1 change: 1 addition & 0 deletions src/commands/integration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const createIntegrationDeployCommand = (program: BaseCommand) => {
.description('Register, build, and deploy a private integration on Netlify')
.option('-p, --prod', 'Deploy to production', false)
.option('-b, --build', 'Build the integration', false)
// The BaseCommand defines an `--auth` option which is hidden from the help by default
.addHelpOption(new Option('-a, --auth <token>', 'Netlify auth token to deploy with'))
.option('-s, --site <name-or-id>', 'A site name or ID to deploy to', env.NETLIFY_SITE_ID)
.action(async (options: OptionValues, command: BaseCommand) => {
Expand Down
5 changes: 3 additions & 2 deletions src/commands/sites/sites.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OptionValues, InvalidArgumentError } from 'commander'
import { OptionValues, InvalidArgumentError, Option } from 'commander'

import BaseCommand from '../base-command.js'

Expand Down Expand Up @@ -71,7 +71,8 @@ export const createSitesCommand = (program: BaseCommand) => {
program
.command('sites:list')
.description('List all sites you have access to')
.option('--json', 'Output site data as JSON')
// The BaseCommand defines a `--json` option which is hidden from the help by default
.addHelpOption(new Option('--json', 'Output site data as JSON'))
.action(async (options: OptionValues, command: BaseCommand) => {
const { sitesList } = await import('./sites-list.js')
await sitesList(options, command)
Expand Down

0 comments on commit 5b9ab21

Please sign in to comment.