Skip to content

Commit

Permalink
Improve Help Text
Browse files Browse the repository at this point in the history
This commit adds additional help text to the `--help`
screen, in a context-sensitive fashion.
  • Loading branch information
norman-abramovitz authored Dec 2, 2020
1 parent a284c4f commit c12f0ac
Showing 1 changed file with 37 additions and 4 deletions.
41 changes: 37 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,35 @@ func options() {
fmt.Printf("\n")
}

func list_options() {
fmt.Printf("Command Options:\n")
fmt.Printf("\n")
fmt.Printf(" -l, --long Display additonal details about service instances\n")
fmt.Printf("\n")
}

func catalog_options() {
fmt.Printf("Command Options:\n")
fmt.Printf("\n")
fmt.Printf(" -l, --long Display additonal details about catalog plans\n")
fmt.Printf("\n")
}

func create_options() {
fmt.Printf("Command Options:\n")
fmt.Printf("\n")
fmt.Printf(" -i, --id Service instance id\n")
fmt.Printf(" -f, --follow Actively display the service log\n")
fmt.Printf("\n")
}

func task_options() {
fmt.Printf("Command Options:\n")
fmt.Printf("\n")
fmt.Printf(" -f, --follow Actively display the service log\n")
fmt.Printf("\n")
}

func bad(command, msg string, args ...interface{}) {
fmt.Printf(msg+"\n", args...)
if command == "" {
Expand Down Expand Up @@ -186,7 +215,8 @@ func main() {

case "list":
if opt.Help {
usage("@C{list}")
usage("@C{list} [command_options]|[options]")
list_options()
options()
os.Exit(0)
}
Expand Down Expand Up @@ -247,7 +277,8 @@ func main() {

case "catalog":
if opt.Help {
usage("@C{catalog}")
usage("@C{catalog} [command_options]|[options]")
catalog_options()
options()
os.Exit(0)
}
Expand Down Expand Up @@ -317,7 +348,8 @@ func main() {

case "create":
if opt.Help {
usage("@C{create} @M{service/plan}")
usage("@C{create} @M{service/plan} [command_options]|[options]")
create_options()
options()
os.Exit(0)
}
Expand Down Expand Up @@ -383,7 +415,8 @@ func main() {

case "task":
if opt.Help {
usage("@C{task} @M{instance}")
usage("@C{task} @M{instance} [command_options]|[options]")
task_options()
options()
os.Exit(0)
}
Expand Down

0 comments on commit c12f0ac

Please sign in to comment.