From d3b8f8889db7fe44e678e1da2395b1ede41807ad Mon Sep 17 00:00:00 2001 From: Lucas Cimon <925560+Lucas-C@users.noreply.github.com> Date: Mon, 29 Nov 2021 23:51:02 +0100 Subject: [PATCH] fix: scriptName + improving usage messages (#305) * Improving usage messages + fixing scriptName * Fixes post-review --- other/MAINTAINING.md | 8 ++++---- src/cli.js | 14 +++++--------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/other/MAINTAINING.md b/other/MAINTAINING.md index 5232261..a31d2ad 100644 --- a/other/MAINTAINING.md +++ b/other/MAINTAINING.md @@ -41,8 +41,8 @@ as you want/need to. Nobody can ask any more of you than that. As a maintainer, you're fine to make your branches on the main repo or on your own fork. Either way is fine. -When we receive a pull request, a travis build is kicked off automatically (see the `.travis.yml` -for what runs in the travis build). We avoid merging anything that breaks the travis build. +When we receive a pull request, a Circle CI build is kicked off automatically (see the `.circleci/` +directory for what runs in the CI pipeline). We avoid merging anything that breaks the CI pipeline. Please review PRs and focus on the code rather than the individual. You never know when this is someone's first ever PR and we want their experience to be as positive as possible, so be @@ -56,8 +56,8 @@ about that. ## Release -Our releases are automatic. They happen whenever code lands into `master`. A travis build gets -kicked off and if it's successful, a tool called +Our releases are automatic. They happen whenever code lands into `master`. A Circle CI build +build gets kicked off and if it's successful, a tool called [`semantic-release`](https://github.com/semantic-release/semantic-release) is used to automatically publish a new release to npm as well as a changelog to GitHub. It is only able to determine the version and whether a release is necessary by the git commit messages. With this diff --git a/src/cli.js b/src/cli.js index 4d35681..7be588e 100755 --- a/src/cli.js +++ b/src/cli.js @@ -16,22 +16,18 @@ const cwd = process.cwd() const defaultRCFile = path.join(cwd, '.all-contributorsrc') const yargv = yargs + .scriptName('all-contributors') .help('help') .alias('h', 'help') .alias('v', 'version') .version() .recommendCommands() - .command('generate', 'Generate the list of contributors') - .usage('Usage: $0 generate') - .command('add', 'add a new contributor') - .usage('Usage: $0 add ') - .command('init', 'Prepare the project to be used with this tool') - .usage('Usage: $0 init') + .command('generate', `Generate the list of contributors\n\nUSAGE: all-contributors generate`) + .command('add', `Add a new contributor\n\nUSAGE: all-contributors add `) + .command('init', `Prepare the project to be used with this tool\n\nUSAGE: all-contributors init`) .command( 'check', - 'Compares contributors from the repository with the ones credited in .all-contributorsrc', - ) - .usage('Usage: $0 check') + `Compare contributors from the repository with the ones credited in .all-contributorsrc'\n\nUSAGE: all-contributors check`) .boolean('commit') .default('files', ['README.md']) .default('contributorsPerLine', 7)