Skip to content

Commit 9f706be

Browse files
committed
Create application command
1 parent a38c311 commit 9f706be

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

application/commands/application/create_app_cmd.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ func (cac *createAppCommand) CommandName() string {
4444
}
4545

4646
func (cac *createAppCommand) buildRequestPayload(ctx *components.Context) (*model.CreateAppRequest, error) {
47-
appKey := ctx.Arguments[0]
48-
displayName := ctx.GetStringFlagValue(commands.DisplayNameFlag)
49-
if displayName == "" {
50-
// Default to the application key if display name is not provided
51-
displayName = appKey
47+
applicationKey := ctx.Arguments[0]
48+
applicationName := ctx.GetStringFlagValue(commands.ApplicationNameFlag)
49+
if applicationName == "" {
50+
// Default to the application key if application name is not provided
51+
applicationName = applicationKey
5252
}
5353

5454
project := ctx.GetStringFlagValue(commands.ProjectFlag)
@@ -81,8 +81,8 @@ func (cac *createAppCommand) buildRequestPayload(ctx *components.Context) (*mode
8181
}
8282

8383
return &model.CreateAppRequest{
84-
ApplicationName: displayName,
85-
ApplicationKey: appKey,
84+
ApplicationName: applicationName,
85+
ApplicationKey: applicationKey,
8686
Description: description,
8787
ProjectKey: project,
8888
MaturityLevel: maturityLevel,

application/commands/flags.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ const (
2121
accessToken = "access-token"
2222
ProjectFlag = "project"
2323

24-
ApplicationKeyFlag = "app-key"
24+
ApplicationKeyFlag = "application-key"
2525
PackageTypeFlag = "package-type"
2626
PackageNameFlag = "package-name"
2727
PackageVersionFlag = "package-version"
2828
PackageRepositoryFlag = "package-repository"
2929
SpecFlag = "spec"
3030
SpecVarsFlag = "spec-vars"
3131
StageVarsFlag = "stage"
32-
DisplayNameFlag = "display-name"
32+
ApplicationNameFlag = "application-name"
3333
DescriptionFlag = "desc"
3434
BusinessCriticalityFlag = "business-criticality"
3535
MaturityLevelFlag = "maturity-level"
@@ -56,7 +56,7 @@ var flagsMap = map[string]components.Flag{
5656
SpecFlag: components.NewStringFlag(SpecFlag, "A path to the specification file.", func(f *components.StringFlag) { f.Mandatory = false }),
5757
SpecVarsFlag: components.NewStringFlag(SpecVarsFlag, "List of semicolon-separated (;) variables in the form of \"key1=value1;key2=value2;...\" (wrapped by quotes) to be replaced in the File Spec. In the File Spec, the variables should be used as follows: ${key1}.", func(f *components.StringFlag) { f.Mandatory = false }),
5858
StageVarsFlag: components.NewStringFlag(StageVarsFlag, "Promotion stage.", func(f *components.StringFlag) { f.Mandatory = true }),
59-
DisplayNameFlag: components.NewStringFlag(DisplayNameFlag, "The display name of the application.", func(f *components.StringFlag) { f.Mandatory = false }),
59+
ApplicationNameFlag: components.NewStringFlag(ApplicationNameFlag, "The display name of the application.", func(f *components.StringFlag) { f.Mandatory = false }),
6060
DescriptionFlag: components.NewStringFlag(DescriptionFlag, "The description of the application.", func(f *components.StringFlag) { f.Mandatory = false }),
6161
BusinessCriticalityFlag: components.NewStringFlag(BusinessCriticalityFlag, "The business criticality level. The following values are supported: "+coreutils.ListToText(model.BusinessCriticalityValues), func(f *components.StringFlag) { f.DefaultValue = model.BusinessCriticalityValues[0] }),
6262
MaturityLevelFlag: components.NewStringFlag(MaturityLevelFlag, "The maturity level.", func(f *components.StringFlag) { f.DefaultValue = model.MaturityLevelValues[0] }),
@@ -101,7 +101,7 @@ var commandFlags = map[string][]string{
101101
user,
102102
accessToken,
103103
ServerId,
104-
DisplayNameFlag,
104+
ApplicationNameFlag,
105105
ProjectFlag,
106106
DescriptionFlag,
107107
BusinessCriticalityFlag,

0 commit comments

Comments
 (0)