hide deprecated commands from the list of commands

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
This commit is contained in:
aramissennyeydd
2025-04-13 16:43:43 -04:00
parent 352e148a74
commit ff618514ff
6 changed files with 34 additions and 10 deletions
@@ -18,9 +18,11 @@ Commands:
config:docs
config:print
config:schema
create-github-app
help [command]
info
migrate [command]
new
package [command]
repo [command]
versions:bump
@@ -132,6 +134,15 @@ Options:
--version
```
### `backstage-cli-alpha create-github-app`
```
Usage: program [options] <github-org>
Options:
-h, --help
```
### `backstage-cli-alpha info`
```
@@ -204,6 +215,23 @@ Options:
-h, --help
```
### `backstage-cli-alpha new`
```
Usage: program [options]
Options:
--baseVersion <version>
--license <license>
--no-private
--npm-registry <URL>
--option <name>=<value>
--scope <scope>
--select <name>
--skip-install
-h, --help
```
### `backstage-cli-alpha package`
```
+2 -8
View File
@@ -12,17 +12,11 @@ Options:
-h, --help
Commands:
build-workspace [options] <workspace-dir> [packages...]
config:check [options]
config:docs [options]
config:print [options]
config:schema [options]
repo [command]
package [command]
versions:bump [options]
versions:migrate [options]
migrate [command]
build-workspace [options] <workspace-dir> [packages...]
info
new [options]
create-github-app <github-org>
help [command]
info
-1
View File
@@ -15,7 +15,6 @@
*/
import { Command } from 'commander';
import { lazy } from '../lib/lazy';
import { registerCommands as registerConfigCommands } from '../modules/config';
import {
registerPackageCommands as registerPackageBuildCommands,
+2
View File
@@ -69,6 +69,7 @@ export default createCliPlugin({
reg.addCommand({
path: ['create'],
description: 'Create a new Backstage app',
deprecated: true,
execute: async () => {
removed("use 'backstage-cli new' instead")();
},
@@ -76,6 +77,7 @@ export default createCliPlugin({
reg.addCommand({
path: ['create-plugin'],
description: 'Create a new Backstage plugin',
deprecated: true,
execute: async () => {
removed("use 'backstage-cli new' instead")();
},
+1 -1
View File
@@ -88,7 +88,7 @@ export class CliInitializer {
);
} else {
argParser
.command(node.name)
.command(node.name, { hidden: !!node.command.deprecated })
.description(node.command.description)
.helpOption(false)
.allowUnknownOption(true)
+1
View File
@@ -18,6 +18,7 @@ import { CommandRegistry } from './CommandRegistry';
export interface BackstageCommand {
path: string[];
description: string;
deprecated?: boolean;
execute: (options: { args: string[] }) => Promise<void>;
}