Skip to content

Commit 5f2a7c7

Browse files
committed
fix: avoid redefining --json option in blobs:get
See tj/commander.js#2055.
1 parent 9280c55 commit 5f2a7c7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/commands/blobs/blobs.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { OptionValues } from 'commander'
1+
import { Option, OptionValues } from 'commander'
22

33
import requiresSiteInfo from '../../utils/hooks/requires-site-info.js'
44
import BaseCommand from '../base-command.js'
@@ -53,7 +53,8 @@ export const createBlobsCommand = (program: BaseCommand) => {
5353
'-p, --prefix <prefix>',
5454
`A string for filtering down the entries; when specified, only the entries whose key starts with that prefix are returned`,
5555
)
56-
.option('--json', `Output list contents as JSON`)
56+
// The BaseCommand defines a `--json` option which is hidden from the help by default
57+
.addHelpOption(new Option('--json', 'Output list contents as JSON'))
5758
.alias('blob:list')
5859
.hook('preAction', requiresSiteInfo)
5960
.action(async (storeName: string, options: OptionValues, command: BaseCommand) => {

0 commit comments

Comments
 (0)