Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ program

program.command('develop')
.description('Start development server. Watches files and rebuilds and hot reloads if something changes') // eslint-disable-line max-len
.option('-h, --host <url>',
.option('-H, --host <url>',
`Set host. Defaults to ${defaultHost}`,
defaultHost
)
Expand Down Expand Up @@ -56,7 +56,7 @@ program.command('build')

program.command('serve-build')
.description('Serve built site.')
.option('-h, --host <url>',
.option('-H, --host <url>',
`Set host. Defaults to ${defaultHost}`,
defaultHost
)
Expand All @@ -78,6 +78,12 @@ program
newCommand(rootPath, starter)
})

program.on('--help', () => {
console.log(`To show subcommand help:

gatsby [command] -h
`)
})

// If the user types an unknown sub-command, just display the help.
const subCmd = process.argv.slice(2, 3)[0]
Expand Down