Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Add help for $ phenomic and unknown commands #757

Closed
wants to merge 3 commits into from
Closed

Conversation

thangngoc89
Copy link
Contributor

Handle some small details of CLI:

.help()
.showHelpOnFail()
Copy link
Owner

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?

Copy link
Contributor Author

@thangngoc89 thangngoc89 Sep 18, 2016

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.

Copy link
Owner

@MoOx MoOx left a 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?

@thangngoc89
Copy link
Contributor Author

I'm busy right now. Will do this tonight

@MoOx
Copy link
Owner

MoOx commented Sep 19, 2016

Yeah sure, no rush :)

@thangngoc89
Copy link
Contributor Author

I updated the PR.

Some screenshots:

image

image

Copy link
Owner

@MoOx MoOx left a 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()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oups :)

Copy link
Contributor Author

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")) +
Copy link
Owner

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

Copy link
Contributor Author

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
// ]
Copy link
Owner

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?

Copy link
Contributor Author

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

@thangngoc89
Copy link
Contributor Author

I'll add some tests with suppose

@thangngoc89
Copy link
Contributor Author

Also add phenomic clean-cache to delete ./node_modules/.cache/phenomic. ETA: unknown

@MoOx
Copy link
Owner

MoOx commented Jan 26, 2017

Will be handled in #936

@MoOx MoOx closed this Jan 26, 2017
@MoOx MoOx deleted the improve-cli branch May 23, 2017 03:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants