@@ -2,6 +2,7 @@ package errors
22
33import (
44 "fmt"
5+ "strings"
56
67 "github.com/spf13/cobra"
78)
@@ -37,14 +38,14 @@ For more details run:
3738
3839 DSA_INVALID_INPUT_PLAN = `the instance plan was not correctly provided.
3940
40- Either provide plan-id by running :
41- $ stackit %[1]s instance %[2]s --project-id xxx --name my-instance -- plan-id <PLAN ID>
41+ Either provide the plan ID :
42+ $ %[1]s -- plan-id <PLAN ID> [flags]
4243
43- or provide plan- name and version:
44- $ stackit %[1]s instance %[2]s --project-id xxx --name my-instance -- plan-name <PLAN NAME> --version <VERSION>
44+ or provide plan name and version:
45+ $ %[1]s -- plan-name <PLAN NAME> --version <VERSION> [flags]
4546
4647For more details on the available plans, run:
47- $ stackit %[1 ]s plans`
48+ $ stackit %[2 ]s plans`
4849
4950 DSA_INVALID_PLAN = `the provided instance plan is not valid.
5051
@@ -55,7 +56,7 @@ For more details on the available plans, run:
5556
5657 DATABASE_INVALID_INPUT_FLAVOR = `the instance flavor was not correctly provided.
5758
58- Either provide flavor-id by running :
59+ Either provide flavor ID by :
5960 $ stackit %[1]s instance %[2]s --project-id xxx --flavor-id <FLAVOR ID> [flags]
6061
6162or provide CPU and RAM:
@@ -121,12 +122,18 @@ func (e *ActivateServiceAccountError) Error() string {
121122}
122123
123124type DSAInputPlanError struct {
124- Service string
125- Operation string
125+ Cmd * cobra. Command
126+ Args [] string
126127}
127128
128129func (e * DSAInputPlanError ) Error () string {
129- return fmt .Sprintf (DSA_INVALID_INPUT_PLAN , e .Service , e .Operation )
130+ fullCommandPath := e .Cmd .CommandPath ()
131+ if len (e .Args ) > 0 {
132+ fullCommandPath = fmt .Sprintf ("%s %s" , fullCommandPath , strings .Join (e .Args , " " ))
133+ }
134+ service := e .Cmd .Parent ().Parent ().Use
135+
136+ return fmt .Sprintf (DSA_INVALID_INPUT_PLAN , fullCommandPath , service )
130137}
131138
132139type DSAInvalidPlanError struct {
0 commit comments