diff --git a/bin/cml.test.js b/bin/cml.test.js index 8391ae447..8465e459b 100644 --- a/bin/cml.test.js +++ b/bin/cml.test.js @@ -8,13 +8,13 @@ describe('command-line interface tests', () => { "cml.js 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 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] diff --git a/bin/cml/pr.js b/bin/cml/pr.js index c7c543cb6..6fc264b47 100644 --- a/bin/cml/pr.js +++ b/bin/cml/pr.js @@ -1,6 +1,6 @@ const { options, handler } = require('./pr/create'); -exports.command = 'pr'; +exports.command = 'pr '; exports.description = 'Manage pull requests'; exports.handler = handler; exports.builder = (yargs) => @@ -9,4 +9,5 @@ exports.builder = (yargs) => .recommendCommands() .env('CML_PR') .options(options) + .check(({ globpath }) => globpath) .strict(); diff --git a/bin/cml/pr/create.test.js b/bin/cml/pr/create.test.js index 4b1cc2547..162deff3e 100644 --- a/bin/cml/pr/create.test.js +++ b/bin/cml/pr/create.test.js @@ -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 Manage pull requests diff --git a/bin/cml/runner.js b/bin/cml/runner.js index fe862ee5e..7e39bdfd8 100644 --- a/bin/cml/runner.js +++ b/bin/cml/runner.js @@ -9,4 +9,5 @@ exports.builder = (yargs) => .recommendCommands() .env('CML_RUNNER') .options(options) + .check(() => process.argv.some((arg) => arg.startsWith('-'))) .strict();