Skip to content

Commit f66b6ac

Browse files
committed
deprecated the main options command
1 parent 0dd3361 commit f66b6ac

File tree

2 files changed

+13
-34
lines changed

2 files changed

+13
-34
lines changed

docs/stackit_ske_options.md

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,18 @@ Lists SKE provider options
44

55
### Synopsis
66

7+
Command "options" is deprecated, use the subcommands instead.
78
Lists STACKIT Kubernetes Engine (SKE) provider options (availability zones, Kubernetes versions, machine images and types, volume types).
89
Pass one or more flags to filter what categories are shown.
910

1011
```
1112
stackit ske options [flags]
1213
```
1314

14-
### Examples
15-
16-
```
17-
List SKE options for all categories
18-
$ stackit ske options
19-
20-
List SKE options regarding Kubernetes versions only
21-
$ stackit ske options --kubernetes-versions
22-
23-
List SKE options regarding Kubernetes versions and machine images
24-
$ stackit ske options --kubernetes-versions --machine-images
25-
```
26-
2715
### Options
2816

2917
```
30-
--availability-zones Lists availability zones
31-
-h, --help Help for "stackit ske options"
32-
--kubernetes-versions Lists supported kubernetes versions
33-
--machine-images Lists supported machine images
34-
--machine-types Lists supported machine types
35-
--volume-types Lists supported volume types
18+
-h, --help Help for "stackit ske options"
3619
```
3720

3821
### Options inherited from parent commands

internal/cmd/ske/options/options.go

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616

1717
"github.com/spf13/cobra"
1818
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
19-
"github.com/stackitcloud/stackit-cli/internal/pkg/examples"
2019
"github.com/stackitcloud/stackit-cli/internal/pkg/flags"
2120
"github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
2221
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
@@ -47,24 +46,15 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
4746
cmd := &cobra.Command{
4847
Use: "options",
4948
Short: "Lists SKE provider options",
50-
Long: fmt.Sprintf("%s\n%s",
49+
Long: fmt.Sprintf("%s\n%s\n%s",
50+
"Command \"options\" is deprecated, use the subcommands instead.",
5151
"Lists STACKIT Kubernetes Engine (SKE) provider options (availability zones, Kubernetes versions, machine images and types, volume types).",
5252
"Pass one or more flags to filter what categories are shown.",
5353
),
54-
Deprecated: "splitted in separate subcommands, use them instead.",
55-
Args: args.NoArgs,
56-
Example: examples.Build(
57-
examples.NewExample(
58-
`List SKE options for all categories`,
59-
"$ stackit ske options"),
60-
examples.NewExample(
61-
`List SKE options regarding Kubernetes versions only`,
62-
"$ stackit ske options --kubernetes-versions"),
63-
examples.NewExample(
64-
`List SKE options regarding Kubernetes versions and machine images`,
65-
"$ stackit ske options --kubernetes-versions --machine-images"),
66-
),
54+
Args: args.NoArgs,
6755
RunE: func(cmd *cobra.Command, args []string) error {
56+
params.Printer.Info("Command \"options\" is deprecated, use the subcommands instead.\n")
57+
6858
ctx := context.Background()
6959
model, err := parseInput(params.Printer, cmd, args)
7060
if err != nil {
@@ -106,6 +96,12 @@ func configureFlags(cmd *cobra.Command) {
10696
cmd.Flags().Bool(machineImagesFlag, false, "Lists supported machine images")
10797
cmd.Flags().Bool(machineTypesFlag, false, "Lists supported machine types")
10898
cmd.Flags().Bool(volumeTypesFlag, false, "Lists supported volume types")
99+
100+
cobra.CheckErr(cmd.Flags().MarkDeprecated(availabilityZonesFlag, "This flag is deprecated and will be removed on 2026-09-26. Use the availability-zone subcommand instead."))
101+
cobra.CheckErr(cmd.Flags().MarkDeprecated(kubernetesVersionsFlag, "This flag is deprecated and will be removed on 2026-09-26. Use the kubernetes-versions subcommand instead."))
102+
cobra.CheckErr(cmd.Flags().MarkDeprecated(machineImagesFlag, "This flag is deprecated and will be removed on 2026-09-26. Use the machine-images subcommand instead."))
103+
cobra.CheckErr(cmd.Flags().MarkDeprecated(machineTypesFlag, "This flag is deprecated and will be removed on 2026-09-26. Use the machine-types subcommand instead."))
104+
cobra.CheckErr(cmd.Flags().MarkDeprecated(volumeTypesFlag, "This flag is deprecated and will be removed on 2026-09-26. Use the volume-types subcommand instead."))
109105
}
110106

111107
func parseInput(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel, error) {

0 commit comments

Comments
 (0)