Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Conversation

rodkeys
Copy link
Contributor

@rodkeys rodkeys commented Mar 27, 2017

Starting jsipfs without any commands crashes it and gives a slightly unclear error message from yargs.

I changed this to have yargs display the original help message on starting jsipfs with no commands.

Also there is a fix for the --help command messages not being displayed at all.

Starting jsipfs without any commands crashes it and gives a slightly unclear error message from yargs.

I changed this to have yargs display the original help message on starting jsipfs with no commands.

Also there is a fix for the --help command messages not being displayed at all.
@daviddias
Copy link
Member

@rodkeys thank you! Great catch, mind updating the tests to reflect this?

Copy link
Member

@nunofmn nunofmn left a comment

Choose a reason for hiding this comment

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

LGTM 👍
Just fix the lint error so the Travis build pass and see my other comments.
Maybe a test case for the help command output would be nice :)

console.error(yargs.help())
process.exit(1)
})

Copy link
Member

Choose a reason for hiding this comment

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

The Travis tests are failing, because the linting is failing with this added empty line :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for catching this, I will update my code

src/cli/bin.js Outdated
.demandCommand(1)
.fail((msg, err, yargs) => {
if (err) throw err // preserve stack
console.error(yargs.help())
Copy link
Member

Choose a reason for hiding this comment

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

Here maybe you could use the showHelp() function instead.

daviddias and others added 3 commits March 27, 2017 19:07
@daviddias daviddias merged commit 25cdcbb into ipfs:master Mar 28, 2017
@rodkeys rodkeys deleted the patch-1 branch March 28, 2017 13:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants