forked from superuser0000/store
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
33 lines (30 loc) · 864 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
import (
"fmt"
"os"
)
func main() {
argsWithoutProg := os.Args[1:]
if len(argsWithoutProg) == 0 || argsWithoutProg[0] == "server" {
runServer()
} else if argsWithoutProg[0] == "sync-models" {
syncModels()
} else if argsWithoutProg[0] == "sync-views" {
syncDatabaseViews()
} else if argsWithoutProg[0] == "update-deposits" {
updateDeposits()
} else if argsWithoutProg[0] == "user" {
username, action, role := argsWithoutProg[1], argsWithoutProg[2], argsWithoutProg[3]
manageRole(username, action, role)
} else if argsWithoutProg[0] == "index" {
indexItems()
} else if argsWithoutProg[0] == "import-metro" {
importMetroStations()
} else if argsWithoutProg[0] == "staff-stats" {
staffStats()
} else if argsWithoutProg[0] == "maintain-transactions" {
maintainTransactions()
} else {
fmt.Println("wrong command")
}
}