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

hide most commands #2324

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
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 @@ -114,7 +114,7 @@ export function registerRunCommand(cli: Command, config: OpticCliConfig) {
cli
.command('run')
.description(
`Optic's workflow command: validate your OpenAPI specification files, check API governance policies, search for breaking changes 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;
};