Update help command

This commit is contained in:
Michał 2024-05-06 17:28:18 +01:00
parent 66fb03fa0d
commit 2f40cdcd64
2 changed files with 10 additions and 7 deletions

View file

@ -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)
}
}

View file

@ -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