Skip to content

Commit

Permalink
hide most commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre-Herve committed Sep 20, 2023
1 parent 04ec3d4 commit 9fa9926
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion projects/optic/src/commands/bundle/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const registerBundle = (cli: Command, config: OpticCliConfig) => {
).hideHelp(true);

cli
.command('bundle')
.command('bundle', { hidden: true })
.configureHelp({
commandUsage: usage,
})
Expand Down
2 changes: 1 addition & 1 deletion projects/optic/src/commands/ci/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const choices: Provider[] = ['github', 'gitlab'];

export const registerCiSetup = (cli: Command, config: OpticCliConfig) => {
cli
.command('setup')
.command('setup', { hidden: true })
.configureHelp({
commandUsage: usage,
})
Expand Down
2 changes: 1 addition & 1 deletion projects/optic/src/commands/dereference/dereference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const registerDereference = (cli: Command, config: OpticCliConfig) => {
).hideHelp(true);

cli
.command('dereference')
.command('dereference', { hidden: true })
.configureHelp({
commandUsage: usage,
})
Expand Down
2 changes: 1 addition & 1 deletion projects/optic/src/commands/diff/diff-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Example usage:

export const registerDiffAll = (cli: Command, config: OpticCliConfig) => {
cli
.command('diff-all')
.command('diff-all', { hidden: true })
.configureHelp({
commandUsage: usage,
})
Expand Down
2 changes: 1 addition & 1 deletion projects/optic/src/commands/diff/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Example usage:

export const registerDiff = (cli: Command, config: OpticCliConfig) => {
cli
.command('diff')
.command('diff', { hidden: true })
.configureHelp({
commandUsage: usage,
})
Expand Down
2 changes: 1 addition & 1 deletion projects/optic/src/commands/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function short(sha: string) {

export const registerHistory = (cli: Command, config: OpticCliConfig) => {
cli
.command('history')
.command('history', { hidden: true })
.configureHelp({ commandUsage: usage })
.addHelpText('after', helpText)
.description('Browse spec history and create a text changelog')
Expand Down
2 changes: 1 addition & 1 deletion projects/optic/src/commands/lint/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const usage = () => `

export const registerLint = (cli: Command, config: OpticCliConfig) => {
cli
.command('lint')
.command('lint', { hidden: true })
.configureHelp({
commandUsage: usage,
})
Expand Down
2 changes: 1 addition & 1 deletion projects/optic/src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export function registerRunCommand(cli: Command, config: OpticCliConfig) {
cli
.command('run')
.description(
`Optic's complete workflow command: find OpenAPI specifications in your repository, lint them, search for breaking changes, update your Optic cloud specs repository, log results and post a human-readable summary of the changes to your pull request.`
`Optic's workflow command: lint OpenAPI specifications, search for breaking changes, enforce custom API governance rules, automatically update your specs to match your tests traffic and post a friendly summary to the PR/MR and .`
)
.configureHelp({ commandUsage: usage })
.option(
Expand Down
8 changes: 5 additions & 3 deletions projects/optic/src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export const initCli = async (
cli.version(packageJson.version);
cli.addHelpCommand(false);

registerRunCommand(cli, cliConfig);
registerDiff(cli, cliConfig);

const betaSubcommands = cli.command('beta', { hidden: true });
Expand All @@ -139,7 +140,7 @@ export const initCli = async (
cli.addCommand(oas, { hidden: true });

// commands for tracking changes with openapi
cli.addCommand(await newCommand());
cli.addCommand(await newCommand(), { hidden: true });
cli.addCommand(await setupTlsCommand(), { hidden: true });
cli.addCommand(verifyCommand(cliConfig), { hidden: true });
cli.addCommand(updateCommand(), { hidden: true });
Expand Down Expand Up @@ -172,12 +173,13 @@ export const initCli = async (
registerSpecPush(specSubcommands, cliConfig);
registerSpecAddApiUrl(specSubcommands, cliConfig);

const ciSubcommands = cli.command('ci').addHelpCommand(false);
const ciSubcommands = cli
.command('ci', { hidden: true })
.addHelpCommand(false);
registerCiComment(ciSubcommands, cliConfig);
registerCiSetup(ciSubcommands, cliConfig);

registerHistory(cli, cliConfig);
registerRunCommand(cli, cliConfig);

return cli;
};

0 comments on commit 9fa9926

Please sign in to comment.