@@ -57,13 +57,13 @@ For more details on the available plans, run:
5757 DATABASE_INVALID_INPUT_FLAVOR = `the instance flavor was not correctly provided.
5858
5959Either provide flavor ID by:
60- $ stackit %[1]s instance %[2]s --project-id xxx --flavor-id <FLAVOR ID> [flags]
60+ $ %[1]s --flavor-id <FLAVOR ID> [flags]
6161
6262or provide CPU and RAM:
63- $ stackit %[1]s instance %[2]s --project-id xxx --cpu <CPU> --ram <RAM> [flags]
63+ $ %[1]s --cpu <CPU> --ram <RAM> [flags]
6464
6565For more details on the available flavors, run:
66- $ stackit %[1 ]s options --flavors`
66+ $ stackit %[2 ]s options --flavors`
6767
6868 DATABASE_INVALID_FLAVOR = `the provided instance flavor is not valid.
6969
@@ -131,6 +131,7 @@ func (e *DSAInputPlanError) Error() string {
131131 if len (e .Args ) > 0 {
132132 fullCommandPath = fmt .Sprintf ("%s %s" , fullCommandPath , strings .Join (e .Args , " " ))
133133 }
134+ // Assumes a structure of the form "stackit <service> <resource> <operation>"
134135 service := e .Cmd .Parent ().Parent ().Use
135136
136137 return fmt .Sprintf (DSA_INVALID_INPUT_PLAN , fullCommandPath , service )
@@ -148,10 +149,19 @@ func (e *DSAInvalidPlanError) Error() string {
148149type DatabaseInputFlavorError struct {
149150 Service string
150151 Operation string
152+ Cmd * cobra.Command
153+ Args []string
151154}
152155
153156func (e * DatabaseInputFlavorError ) Error () string {
154- return fmt .Sprintf (DATABASE_INVALID_INPUT_FLAVOR , e .Service , e .Operation )
157+ fullCommandPath := e .Cmd .CommandPath ()
158+ if len (e .Args ) > 0 {
159+ fullCommandPath = fmt .Sprintf ("%s %s" , fullCommandPath , strings .Join (e .Args , " " ))
160+ }
161+ // Assumes a structure of the form "stackit <service> <resource> <operation>"
162+ service := e .Cmd .Parent ().Parent ().Use
163+
164+ return fmt .Sprintf (DATABASE_INVALID_INPUT_FLAVOR , fullCommandPath , service )
155165}
156166
157167type DatabaseInvalidFlavorError struct {
0 commit comments