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 ca516f4
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 10 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
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 ca516f4

Please sign in to comment.