@@ -11,7 +11,6 @@ import (
1111 "github.com/stackitcloud/stackit-cli/internal/pkg/args"
1212 "github.com/stackitcloud/stackit-cli/internal/pkg/errors"
1313 "github.com/stackitcloud/stackit-cli/internal/pkg/examples"
14- "github.com/stackitcloud/stackit-cli/internal/pkg/flags"
1514 "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
1615 "github.com/stackitcloud/stackit-cli/internal/pkg/print"
1716 "github.com/stackitcloud/stackit-cli/internal/pkg/services/iaas/client"
@@ -24,13 +23,11 @@ import (
2423
2524const (
2625 serverIdArg = "SERVER_ID"
27- detailsFlag = "details"
2826)
2927
3028type inputModel struct {
3129 * globalflags.GlobalFlagModel
3230 ServerId string
33- Details bool
3431}
3532
3633func NewCmd (p * print.Printer ) * cobra.Command {
@@ -44,10 +41,6 @@ func NewCmd(p *print.Printer) *cobra.Command {
4441 `Show details of a server with ID "xxx"` ,
4542 "$ stackit beta server describe xxx" ,
4643 ),
47- examples .NewExample (
48- `Show detailed information of a server with ID "xxx"` ,
49- "$ stackit beta server describe xxx --details" ,
50- ),
5144 examples .NewExample (
5245 `Show details of a server with ID "xxx" in JSON format` ,
5346 "$ stackit beta server describe xxx --output-format json" ,
@@ -76,14 +69,9 @@ func NewCmd(p *print.Printer) *cobra.Command {
7669 return outputResult (p , model , resp )
7770 },
7871 }
79- configureFlags (cmd )
8072 return cmd
8173}
8274
83- func configureFlags (cmd * cobra.Command ) {
84- cmd .Flags ().Bool (detailsFlag , false , "Show detailed information about server" )
85- }
86-
8775func parseInput (p * print.Printer , cmd * cobra.Command , inputArgs []string ) (* inputModel , error ) {
8876 serverId := inputArgs [0 ]
8977
@@ -95,7 +83,6 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
9583 model := inputModel {
9684 GlobalFlagModel : globalFlags ,
9785 ServerId : serverId ,
98- Details : flags .FlagToBoolValue (p , cmd , detailsFlag ),
9986 }
10087
10188 if p .IsVerbosityDebug () {
@@ -112,10 +99,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
11299
113100func buildRequest (ctx context.Context , model * inputModel , apiClient * iaas.APIClient ) iaas.ApiGetServerRequest {
114101 req := apiClient .GetServer (ctx , model .ProjectId , model .ServerId )
115-
116- if model .Details {
117- req = req .Details (true )
118- }
102+ req = req .Details (true )
119103
120104 return req
121105}
@@ -142,9 +126,8 @@ func outputResult(p *print.Printer, model *inputModel, server *iaas.Server) erro
142126 return nil
143127 default :
144128 table := tables .NewTable ()
145- if model .Details {
146- table .SetTitle ("Server" )
147- }
129+ table .SetTitle ("Server" )
130+
148131 table .AddRow ("ID" , * server .Id )
149132 table .AddSeparator ()
150133 table .AddRow ("NAME" , * server .Name )
@@ -204,11 +187,6 @@ func outputResult(p *print.Printer, model *inputModel, server *iaas.Server) erro
204187 return fmt .Errorf ("render table: %w" , err )
205188 }
206189
207- // If no --details is set, we only display the overview table
208- if ! model .Details {
209- return nil
210- }
211-
212190 if server .Nics != nil && len (* server .Nics ) > 0 {
213191 nicsTable := tables .NewTable ()
214192 nicsTable .SetTitle ("Attached Network Interfaces" )
0 commit comments