Skip to content

Commit

Permalink
Enhance help messages on legacy overloaded commands
Browse files Browse the repository at this point in the history
  • Loading branch information
iterative-olivaw authored Jun 22, 2022
1 parent 72359eb commit da8c820
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
14 changes: 7 additions & 7 deletions bin/cml.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ describe('command-line interface tests', () => {
"cml.js <command>
Commands:
cml.js check Manage continuous integration checks
cml.js pr Manage pull requests
cml.js report Manage reports
cml.js repository Manage repository settings
cml.js runner Manage continuous integration self-hosted runners
cml.js tensorboard Manage tensorboard.dev agents
cml.js workflow Manage continuous integration workflows
cml.js check Manage continuous integration checks
cml.js pr <glob path...> Manage pull requests
cml.js report Manage reports
cml.js repository Manage repository settings
cml.js runner Manage continuous integration self-hosted runners
cml.js tensorboard Manage tensorboard.dev agents
cml.js workflow Manage continuous integration workflows
Options:
--help Show help [boolean]
Expand Down
3 changes: 2 additions & 1 deletion bin/cml/pr.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { options, handler } = require('./pr/create');

exports.command = 'pr';
exports.command = 'pr <glob path...>';
exports.description = 'Manage pull requests';
exports.handler = handler;
exports.builder = (yargs) =>
Expand All @@ -9,4 +9,5 @@ exports.builder = (yargs) =>
.recommendCommands()
.env('CML_PR')
.options(options)
.check(({ globpath }) => globpath)
.strict();
2 changes: 1 addition & 1 deletion bin/cml/pr/create.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('CML e2e', () => {
const output = await exec(`echo none | node ./bin/cml.js pr --help`);

expect(output).toMatchInlineSnapshot(`
"cml.js pr
"cml.js pr <glob path...>
Manage pull requests
Expand Down
1 change: 1 addition & 0 deletions bin/cml/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ exports.builder = (yargs) =>
.recommendCommands()
.env('CML_RUNNER')
.options(options)
.check(() => process.argv.some((arg) => arg.startsWith('-')))
.strict();

3 comments on commit da8c820

@github-actions

This comment was marked as outdated.

@0x2b3bfa0

This comment was marked as outdated.

@0x2b3bfa0

This comment was marked as outdated.

Please sign in to comment.