Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide Docs URLs in --help messaging #1232

Merged
merged 4 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bin/cml/asset/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ const winston = require('winston');

const { CML } = require('../../../src/cml');

const DESCRIPTION = 'Publish an asset';
const DOCSURL = 'https://cml.dev/doc/usage#cml-reports';

exports.command = 'publish <asset>';
exports.description = 'Publish an asset';
exports.description = `${DESCRIPTION}\n${DOCSURL}`;

exports.handler = async (opts) => {
if (opts.gitlabUploads) {
Expand Down
5 changes: 4 additions & 1 deletion bin/cml/check/create.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
const fs = require('fs').promises;
const kebabcaseKeys = require('kebabcase-keys');

const DESCRIPTION = 'Create a check report';
const DOCSURL = 'https://cml.dev/doc/ref/check';

exports.command = 'create <markdown file>';
exports.description = 'Create a check report';
exports.description = `${DESCRIPTION}\n${DOCSURL}`;

exports.handler = async (opts) => {
const { cml, markdownfile } = opts;
Expand Down
5 changes: 4 additions & 1 deletion bin/cml/comment/create.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const kebabcaseKeys = require('kebabcase-keys');

const DESCRIPTION = 'Create a comment';
const DOCSURL = 'https://cml.dev/doc/ref/comment#create';

exports.command = 'create <markdown file>';
exports.description = 'Create a comment';
exports.description = `${DESCRIPTION}\n${DOCSURL}`;

exports.handler = async (opts) => {
const { cml } = opts;
Expand Down
5 changes: 4 additions & 1 deletion bin/cml/comment/update.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const { builder, handler } = require('./create');

const DESCRIPTION = 'Update a comment';
const DOCSURL = 'https://cml.dev/doc/ref/comment#update';

exports.command = 'update <markdown file>';
exports.description = 'Update a comment';
exports.description = `${DESCRIPTION}\n${DOCSURL}`;

exports.handler = async (opts) => {
await handler({ ...opts, update: true });
Expand Down
1 change: 1 addition & 0 deletions bin/cml/pr/create.e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('CML e2e', () => {
Commands:
cml.js pr create <glob path...> Create a pull request with the specified
files
https://cml.dev/doc/ref/pr

Global Options:
--log Logging verbosity
Expand Down
5 changes: 4 additions & 1 deletion bin/cml/pr/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ const {
GIT_USER_EMAIL
} = require('../../../src/cml');

const DESCRIPTION = 'Create a pull request with the specified files';
const DOCSURL = 'https://cml.dev/doc/ref/pr';

exports.command = 'create <glob path...>';
exports.description = 'Create a pull request with the specified files';
exports.description = `${DESCRIPTION}\n${DOCSURL}`;

exports.handler = async (opts) => {
const { cml, globpath: globs } = opts;
Expand Down
5 changes: 4 additions & 1 deletion bin/cml/repo/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ const kebabcaseKeys = require('kebabcase-keys');

const { GIT_USER_NAME, GIT_USER_EMAIL } = require('../../../src/cml');

const DESCRIPTION = 'Prepare the cloned repository';
const DOCSURL = 'https://cml.dev/doc/ref/ci';

exports.command = 'prepare';
exports.description = 'Prepare the cloned repository';
exports.description = `${DESCRIPTION}\n${DOCSURL}`;

exports.handler = async (opts) => {
const { cml } = opts;
Expand Down
5 changes: 4 additions & 1 deletion bin/cml/runner/launch.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,11 @@ const run = async (opts) => {
else await runLocal(opts);
};

const DESCRIPTION = 'Launch and register a self-hosted runner';
const DOCSURL = 'https://cml.dev/doc/ref/runner';

exports.command = 'launch';
exports.description = 'Launch and register a self-hosted runner';
exports.description = `${DESCRIPTION}\n${DOCSURL}`;

exports.handler = async (opts) => {
({ cml } = opts);
Expand Down
1 change: 1 addition & 0 deletions bin/cml/runner/launch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe('CML e2e', () => {

Commands:
cml.js runner launch Launch and register a self-hosted runner
https://cml.dev/doc/ref/runner

Global Options:
--log Logging verbosity
Expand Down
6 changes: 5 additions & 1 deletion bin/cml/tensorboard/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ const launchAndWaitLink = async (opts = {}) => {
};

exports.tbLink = tbLink;

const DESCRIPTION = 'Connect to tensorboard.dev and get a link';
const DOCSURL = 'https://cml.dev/doc/ref/tensorboard';

exports.command = 'connect';
exports.description = 'Connect to tensorboard.dev and get a link';
exports.description = `${DESCRIPTION}\n${DOCSURL}`;

exports.handler = async (opts) => {
const { file, credentials, name, description } = opts;
Expand Down
5 changes: 4 additions & 1 deletion bin/cml/workflow/rerun.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const kebabcaseKeys = require('kebabcase-keys');

const DESCRIPTION = 'Rerun a workflow given the jobId or workflowId';
const DOCSURL = 'https://cml.dev/doc/ref/workflow';

exports.command = 'rerun';
exports.description = 'Rerun a workflow given the jobId or workflowId';
exports.description = `${DESCRIPTION}\n${DOCSURL}`;

exports.handler = async (opts) => {
const { cml } = opts;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.