Skip to content

Commit 4561274

Browse files
authored
Add quotes around variables in prints (#99)
* Add quotes around variables in prints * Small fix
1 parent 72c2369 commit 4561274

File tree

86 files changed

+141
-141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+141
-141
lines changed

internal/cmd/dns/zone/create/create.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func NewCmd() *cobra.Command {
8585
}
8686

8787
if !model.AssumeYes {
88-
prompt := fmt.Sprintf("Are you sure you want to create a zone for project %s?", projectLabel)
88+
prompt := fmt.Sprintf("Are you sure you want to create a zone for project %q?", projectLabel)
8989
err = confirm.PromptForConfirmation(cmd, prompt)
9090
if err != nil {
9191
return err
@@ -115,7 +115,7 @@ func NewCmd() *cobra.Command {
115115
if model.Async {
116116
operationState = "Triggered creation of"
117117
}
118-
cmd.Printf("%s zone for project %s. Zone ID: %s\n", operationState, projectLabel, zoneId)
118+
cmd.Printf("%s zone for project %q. Zone ID: %s\n", operationState, projectLabel, zoneId)
119119
return nil
120120
},
121121
}

internal/cmd/dns/zone/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func NewCmd() *cobra.Command {
8787
if err != nil {
8888
projectLabel = model.ProjectId
8989
}
90-
cmd.Printf("No zones found for project %s matching the criteria\n", projectLabel)
90+
cmd.Printf("No zones found for project %q matching the criteria\n", projectLabel)
9191
return nil
9292
}
9393

internal/cmd/logme/credentials/create/create.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func NewCmd() *cobra.Command {
6161
}
6262

6363
if !model.AssumeYes {
64-
prompt := fmt.Sprintf("Are you sure you want to create credentials for instance %s?", instanceLabel)
64+
prompt := fmt.Sprintf("Are you sure you want to create credentials for instance %q?", instanceLabel)
6565
err = confirm.PromptForConfirmation(cmd, prompt)
6666
if err != nil {
6767
return err
@@ -75,7 +75,7 @@ func NewCmd() *cobra.Command {
7575
return fmt.Errorf("create LogMe credentials: %w", err)
7676
}
7777

78-
cmd.Printf("Created credentials for instance %s. Credentials ID: %s\n\n", instanceLabel, *resp.Id)
78+
cmd.Printf("Created credentials for instance %q. Credentials ID: %s\n\n", instanceLabel, *resp.Id)
7979
// The username field cannot be set by the user so we only display it if it's not returned empty
8080
username := *resp.Raw.Credentials.Username
8181
if username != "" {

internal/cmd/logme/credentials/delete/delete.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func NewCmd() *cobra.Command {
6565
}
6666

6767
if !model.AssumeYes {
68-
prompt := fmt.Sprintf("Are you sure you want to delete credentials %s of instance %s? (This cannot be undone)", credentialsLabel, instanceLabel)
68+
prompt := fmt.Sprintf("Are you sure you want to delete credentials %s of instance %q? (This cannot be undone)", credentialsLabel, instanceLabel)
6969
err = confirm.PromptForConfirmation(cmd, prompt)
7070
if err != nil {
7171
return err
@@ -79,7 +79,7 @@ func NewCmd() *cobra.Command {
7979
return fmt.Errorf("delete LogMe credentials: %w", err)
8080
}
8181

82-
cmd.Printf("Deleted credentials %s of instance %s\n", credentialsLabel, instanceLabel)
82+
cmd.Printf("Deleted credentials %s of instance %q\n", credentialsLabel, instanceLabel)
8383
return nil
8484
},
8585
}

internal/cmd/logme/credentials/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func NewCmd() *cobra.Command {
7171
if err != nil {
7272
instanceLabel = model.InstanceId
7373
}
74-
cmd.Printf("No credentials found for instance %s\n", instanceLabel)
74+
cmd.Printf("No credentials found for instance %q\n", instanceLabel)
7575
return nil
7676
}
7777

internal/cmd/logme/instance/create/create.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func NewCmd() *cobra.Command {
9191
}
9292

9393
if !model.AssumeYes {
94-
prompt := fmt.Sprintf("Are you sure you want to create a LogMe instance for project %s?", projectLabel)
94+
prompt := fmt.Sprintf("Are you sure you want to create a LogMe instance for project %q?", projectLabel)
9595
err = confirm.PromptForConfirmation(cmd, prompt)
9696
if err != nil {
9797
return err
@@ -128,7 +128,7 @@ func NewCmd() *cobra.Command {
128128
if model.Async {
129129
operationState = "Triggered creation of"
130130
}
131-
cmd.Printf("%s instance for project %s. Instance ID: %s\n", operationState, projectLabel, instanceId)
131+
cmd.Printf("%s instance for project %q. Instance ID: %s\n", operationState, projectLabel, instanceId)
132132
return nil
133133
},
134134
}

internal/cmd/logme/instance/delete/delete.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func NewCmd() *cobra.Command {
5858
}
5959

6060
if !model.AssumeYes {
61-
prompt := fmt.Sprintf("Are you sure you want to delete instance %s? (This cannot be undone)", instanceLabel)
61+
prompt := fmt.Sprintf("Are you sure you want to delete instance %q? (This cannot be undone)", instanceLabel)
6262
err = confirm.PromptForConfirmation(cmd, prompt)
6363
if err != nil {
6464
return err
@@ -87,7 +87,7 @@ func NewCmd() *cobra.Command {
8787
if model.Async {
8888
operationState = "Triggered deletion of"
8989
}
90-
cmd.Printf("%s instance %s\n", operationState, instanceLabel)
90+
cmd.Printf("%s instance %q\n", operationState, instanceLabel)
9191
return nil
9292
},
9393
}

internal/cmd/logme/instance/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func NewCmd() *cobra.Command {
6969
if err != nil {
7070
projectLabel = model.ProjectId
7171
}
72-
cmd.Printf("No instances found for project %s\n", projectLabel)
72+
cmd.Printf("No instances found for project %q\n", projectLabel)
7373
return nil
7474
}
7575

internal/cmd/logme/instance/update/update.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func NewCmd() *cobra.Command {
8989
}
9090

9191
if !model.AssumeYes {
92-
prompt := fmt.Sprintf("Are you sure you want to update instance %s?", instanceLabel)
92+
prompt := fmt.Sprintf("Are you sure you want to update instance %q?", instanceLabel)
9393
err = confirm.PromptForConfirmation(cmd, prompt)
9494
if err != nil {
9595
return err
@@ -126,7 +126,7 @@ func NewCmd() *cobra.Command {
126126
if model.Async {
127127
operationState = "Triggered update of"
128128
}
129-
cmd.Printf("%s instance %s\n", operationState, instanceLabel)
129+
cmd.Printf("%s instance %q\n", operationState, instanceLabel)
130130
return nil
131131
},
132132
}

internal/cmd/logme/plans/plans.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func NewCmd() *cobra.Command {
6969
if err != nil {
7070
projectLabel = model.ProjectId
7171
}
72-
cmd.Printf("No plans found for project %s\n", projectLabel)
72+
cmd.Printf("No plans found for project %q\n", projectLabel)
7373
return nil
7474
}
7575

0 commit comments

Comments
 (0)