Skip to content

Commit

Permalink
clearer error message
Browse files Browse the repository at this point in the history
  • Loading branch information
tttp committed Nov 3, 2023
1 parent 70148c9 commit c79a8c0
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions sdk/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,7 @@ export default function cli() {

const argv = yargs
.scriptName('proca-cli')
.command(
['setup', '$0'],
'configure proca CLI (generates .env, keys.json files)',
{},
cmd(setup)
)
.usage('$0 <cmd> [args]')
.option('debug', {
alias: 'D',
type: 'boolean',
Expand Down Expand Up @@ -189,6 +184,16 @@ export default function cli() {
default: false
})
.command('token', 'print basic auth token', {}, cmd(showToken))
.command('$0', 'missing param', () => {}, (argv) => {
console.log('missing params, --help. the first time you need to run setup')
})

.command(
'setup',
'configure proca CLI (generates .env, keys.json files)',
{},
cmd(setup)
)
.command('org:add', 'add a new organisation', {
name: {
alias: 'n',
Expand Down Expand Up @@ -467,6 +472,7 @@ export default function cli() {
}
}, cmd(syncFile))

.help()
.argv
// .demandCommand().argv;
}

0 comments on commit c79a8c0

Please sign in to comment.