Skip to content

Commit 695bed5

Browse files
Merge pull request #39 from stackroost/dev
fix(cli): remove redundant newlines in fmt.Println for help output
2 parents c08bf8d + e524e8c commit 695bed5

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

cmd/root.go

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,14 @@ func registerUserCmds() {
385385
}
386386

387387
func customHelpFunc(cmd *cobra.Command, args []string) {
388-
fmt.Println("\nStackRoost CLI - manage your Linux servers with ease\n")
389-
fmt.Println("Usage:\n stackroost [command]\n")
390-
fmt.Println("Available Commands:")
388+
fmt.Println()
389+
fmt.Println("StackRoost CLI - manage your Linux servers with ease")
390+
fmt.Println()
391+
fmt.Println("Usage:")
392+
fmt.Println(" stackroost [command]")
393+
fmt.Println()
394+
fmt.Println("Available Commands:")
395+
391396

392397
group := map[string][]*cobra.Command{}
393398

@@ -418,11 +423,13 @@ func customHelpFunc(cmd *cobra.Command, args []string) {
418423
}
419424

420425
for title, commands := range group {
421-
fmt.Printf("\n%s\n", title)
422-
for _, c := range commands {
423-
fmt.Printf(" %-22s %s\n", c.Use, c.Short)
424-
}
426+
fmt.Printf("\n%s\n", title)
427+
for _, c := range commands {
428+
fmt.Printf(" %-22s %s\n", c.Use, c.Short)
425429
}
430+
}
431+
432+
fmt.Println()
433+
fmt.Println("Use \"stackroost [command] --help\" for more information about a command.")
426434

427-
fmt.Println("\nUse \"stackroost [command] --help\" for more information about a command.\n")
428435
}

0 commit comments

Comments
 (0)