mirror of
https://github.com/Fluffy-Bean/TastyBites.git
synced 2025-06-20 00:50:35 +00:00
Add run commands
This commit is contained in:
parent
ac0a8df205
commit
4318b3ed47
5 changed files with 80 additions and 19 deletions
26
cmd/cmd.go
Normal file
26
cmd/cmd.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
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:])
|
||||
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)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue