Skip to content

Commit 0ebb10a

Browse files
[POA-752] Mark old commands as deprecated (#253)
* Marked old commands as deprecated, they will not show in help text now * `might be removed` for `ec2` and `kube` * `will be removed` for `daemon` and `nginx`
1 parent 2e87baf commit 0ebb10a

File tree

22 files changed

+7
-38
lines changed

22 files changed

+7
-38
lines changed

cmd/internal/ec2/ec2.go

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var (
1717
)
1818

1919
var Cmd = &cobra.Command{
20+
Deprecated: "This is no longer supported and might be removed in a future release.",
2021
Use: "setup",
2122
Short: "Add the Postman Live Collections Agent to the current server.",
2223
Long: "The CLI will add the Postman Live Collections Agent as a systemd service to your current server.",

cmd/internal/kube/kube.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import (
55
)
66

77
var Cmd = &cobra.Command{
8-
Use: "kube",
9-
Short: "Install the Postman Live Collections Agent in your Kubernetes cluster",
8+
Deprecated: "This is no longer supported and might be removed in a future release.",
9+
Use: "kube",
10+
Short: "Install the Postman Live Collections Agent in your Kubernetes cluster",
1011
Aliases: []string{
1112
"k8s",
1213
"kubernetes",
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

cmd/internal/daemon/cmd.go cmd/internal/legacy/daemon/cmd.go

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var (
2424
)
2525

2626
var Cmd = &cobra.Command{
27+
Deprecated: "This is no longer supported and will be removed in a future release.",
2728
Use: "daemon",
2829
Short: "Run the Akita client daemon.",
2930
SilenceUsage: true,
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

cmd/internal/nginx/nginx.go cmd/internal/legacy/nginx/nginx.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ var (
2929
)
3030

3131
var Cmd = &cobra.Command{
32+
Deprecated: "This is no longer supported and will be removed in a future release.",
3233
Use: "nginx",
3334
Short: "Install or use Akita's NGINX module to collect API traffic.",
3435
SilenceUsage: true,
35-
Hidden: false,
3636
}
3737

3838
var CaptureCmd = &cobra.Command{
File renamed without changes.
File renamed without changes.
File renamed without changes.

cmd/root.go

+1-35
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,12 @@ import (
1313
flag "github.com/spf13/pflag"
1414
"github.com/spf13/viper"
1515

16-
"github.com/akitasoftware/akita-cli/cmd/internal/apidiff"
1716
"github.com/akitasoftware/akita-cli/cmd/internal/apidump"
18-
"github.com/akitasoftware/akita-cli/cmd/internal/apispec"
19-
"github.com/akitasoftware/akita-cli/cmd/internal/ascii"
2017
"github.com/akitasoftware/akita-cli/cmd/internal/ci_guard"
2118
"github.com/akitasoftware/akita-cli/cmd/internal/cmderr"
22-
"github.com/akitasoftware/akita-cli/cmd/internal/daemon"
2319
"github.com/akitasoftware/akita-cli/cmd/internal/ec2"
2420
"github.com/akitasoftware/akita-cli/cmd/internal/ecs"
25-
"github.com/akitasoftware/akita-cli/cmd/internal/get"
2621
"github.com/akitasoftware/akita-cli/cmd/internal/kube"
27-
"github.com/akitasoftware/akita-cli/cmd/internal/learn"
28-
"github.com/akitasoftware/akita-cli/cmd/internal/legacy"
29-
"github.com/akitasoftware/akita-cli/cmd/internal/login"
30-
"github.com/akitasoftware/akita-cli/cmd/internal/nginx"
31-
"github.com/akitasoftware/akita-cli/cmd/internal/setversion"
3222
"github.com/akitasoftware/akita-cli/pcap"
3323
"github.com/akitasoftware/akita-cli/printer"
3424
"github.com/akitasoftware/akita-cli/rest"
@@ -270,33 +260,9 @@ func init() {
270260

271261
// Register subcommands. Most commands that interact with Akita Cloud should
272262
// be guarded by ci_guard.
273-
rootCmd.AddCommand(ci_guard.GuardCommand(apidiff.Cmd))
274263
rootCmd.AddCommand(ci_guard.GuardCommand(apidump.Cmd))
275-
rootCmd.AddCommand(ci_guard.GuardCommand(apispec.Cmd))
276-
daemon.Cmd.Hidden = true
277-
rootCmd.AddCommand(daemon.Cmd)
278-
rootCmd.AddCommand(ci_guard.GuardCommand(learn.Cmd))
279-
login.Cmd.Hidden = true
280-
rootCmd.AddCommand(login.Cmd)
281-
rootCmd.AddCommand(ci_guard.GuardCommand(setversion.Cmd))
282-
283-
// The upload command is disabled until the back end can support it properly.
284-
// Keeping its code around until we can resurrect this feature.
285-
//
286-
// rootCmd.AddCommand(ci_guard.GuardCommand(upload.Cmd))
287-
288-
rootCmd.AddCommand(ci_guard.GuardCommand(get.Cmd))
264+
289265
rootCmd.AddCommand(ecs.Cmd)
290-
rootCmd.AddCommand(nginx.Cmd)
291266
rootCmd.AddCommand(kube.Cmd)
292267
rootCmd.AddCommand(ec2.Cmd)
293-
294-
// Legacy commands, included for backward compatibility but are hidden.
295-
legacy.SessionsCmd.Hidden = true
296-
rootCmd.AddCommand(legacy.SessionsCmd)
297-
legacy.SpecsCmd.Hidden = true
298-
rootCmd.AddCommand(legacy.SpecsCmd)
299-
300-
// Special hidden comands
301-
rootCmd.AddCommand(ascii.Cmd)
302268
}

0 commit comments

Comments
 (0)