-
Notifications
You must be signed in to change notification settings - Fork 249
Add help for $ phenomic
and unknown commands
#757
Conversation
.help() | ||
.showHelpOnFail() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this thing not working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not working at all since we don't any validations with yargs.check()
. But this is actually an interesting idea. I could move the validation part to yarts.check()
and let yargs its jobs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make the change we discussed about?
I'm busy right now. Will do this tonight |
Yeah sure, no rush :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add some test for this as we are currently decreasing coverage more and more :/
@@ -6,7 +6,8 @@ import definitions from "./definitions.js" | |||
|
|||
yargs | |||
.version(() => version) | |||
.help() | |||
.usage("Usage: phenomic <command> [options]") | |||
// .hep() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oups :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops :D
const currentCommand = argv._[2] | ||
if ([ "start", "build", "setup" ].indexOf(currentCommand) < 0) { | ||
throw new Error( | ||
colors.bgRed(colors.white("ERROR")) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably try to output a more fancy error prefix than "ERROR" :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MoOx what are you suggesting?
// nodePath, | ||
// pathToPhenomicScript, | ||
// input argvs | ||
// ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this commented code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I added this on purpose to explain about argv._.length < 3
I'll add some tests with |
Also add |
Will be handled in #936 |
Handle some small details of CLI:
$ phenomic
without any command/ options (Closes$ phenomic
does nothing #513)