Skip to content

Commit

Permalink
docs: show homepage on --help
Browse files Browse the repository at this point in the history
  • Loading branch information
piejanssens committed Mar 9, 2023
1 parent 1559b31 commit 64c881b
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,34 @@ try {
'-d': '--dir',
})
} catch (err) {
if (err.code === 'ARG_UNKNOWN_OPTION') {
log.error(err.message)
} else {
throw err
switch (err.code) {
case 'ARG_UNKNOWN_OPTION':
log.error(err.message)
break
case 'ARG_MISSING_REQUIRED_LONGARG':
log.error(
'One or more arguments is used incorrectly, are you forgetting to provide value perhaps?'
)
break
default:
throw err
break
}
}

if (args['--dir']) {
process.chdir(args['--dir'])
}

if (!args['--raw']) {
log.info(`ℹ️ PEM files directory is set to ${cwd()}`)
}

if (args['--help']) {
log.info('See README.md')
log.notice('Please visit https://npmjs.com/sf-oauth')
exit(0)
}

if (!args['--raw']) {
log.info(`ℹ️ PEM files directory is set to ${cwd()}`)
}

if (args['--generate']) {
if (!args['--hostname']) {
log.error(
Expand Down

0 comments on commit 64c881b

Please sign in to comment.