2024-04-27 14:01:54 +00:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Parse() {
|
|
|
|
if len(os.Args) < 2 {
|
|
|
|
fmt.Println("Use -h or --help for usage")
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
|
|
|
|
switch os.Args[1] {
|
|
|
|
case "run":
|
|
|
|
run(os.Args[2:])
|
2024-05-05 16:51:34 +00:00
|
|
|
case "migrate":
|
|
|
|
migrate(os.Args[2:])
|
2024-05-06 16:24:24 +00:00
|
|
|
case "status":
|
|
|
|
status(os.Args[2:])
|
2024-04-27 14:01:54 +00:00
|
|
|
case "-h":
|
|
|
|
case "--help":
|
|
|
|
fmt.Println("Available commands are:")
|
|
|
|
fmt.Println(" run: starts the server")
|
|
|
|
fmt.Println("\nTo specific usages, run commandName -h")
|
|
|
|
default:
|
|
|
|
fmt.Println("Use -h or --help for usage")
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
}
|