mirror of
https://github.com/Fluffy-Bean/TastyBites.git
synced 2025-01-29 17:48:28 +00:00
Update help command
This commit is contained in:
parent
66fb03fa0d
commit
2f40cdcd64
11
cmd/cmd.go
11
cmd/cmd.go
|
@ -7,7 +7,7 @@ import (
|
|||
|
||||
func Parse() {
|
||||
if len(os.Args) < 2 {
|
||||
fmt.Println("Use -h or --help for usage")
|
||||
fmt.Println("Use -h or -help for usage")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
@ -19,12 +19,15 @@ func Parse() {
|
|||
case "status":
|
||||
status(os.Args[2:])
|
||||
case "-h":
|
||||
case "--help":
|
||||
fallthrough
|
||||
case "-help":
|
||||
fmt.Println("Available commands are:")
|
||||
fmt.Println(" run: starts the server")
|
||||
fmt.Println(" run: starts the server")
|
||||
fmt.Println(" migrate: migrates database")
|
||||
fmt.Println(" status: checks if there are pending migrations")
|
||||
fmt.Println("\nTo specific usages, run commandName -h")
|
||||
default:
|
||||
fmt.Println("Use -h or --help for usage")
|
||||
fmt.Println("Use -h or -help for usage")
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,12 +44,12 @@ func Status() error {
|
|||
return err
|
||||
}
|
||||
|
||||
fmt.Println("Migration list:")
|
||||
fmt.Println("Available migrations:")
|
||||
for _, migration := range applied {
|
||||
fmt.Printf("DONE: %s\n", migration.Id)
|
||||
fmt.Printf(" Complete: %s\n", migration.Id)
|
||||
}
|
||||
for _, migration := range planned {
|
||||
fmt.Printf("TODO: %s\n", migration.Id)
|
||||
fmt.Printf(" Pending: %s\n", migration.Id)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue