-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
47 lines (37 loc) · 1.93 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package main
import (
"flag"
"fmt"
"os"
"github.com/fatih/color"
"github.com/nthnn/AnkoWeb/server"
)
func printBanner() {
color.New(color.FgHiBlue).Print(`
█████╗ ███╗ ██╗██╗ ██╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔══██╗████╗ ██║██║ ██╔╝██╔═══██╗██║ ██║██╔════╝██╔══██╗
███████║██╔██╗ ██║█████╔╝ ██║ ██║██║ █╗ ██║█████╗ ██████╔╝
██╔══██║██║╚██╗██║██╔═██╗ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
██║ ██║██║ ╚████║██║ ██╗╚██████╔╝╚███╔███╔╝███████╗██████╔╝
╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═════╝
`,
)
}
func initFlags() {
flag.CommandLine.SetOutput(os.Stdout)
flag.Usage = func() {
printBanner()
color.New(color.FgHiYellow).Print(" AnkoWeb v0.0.1 - Primitive Version\n\n")
fmt.Println("–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––")
fmt.Println("Parameters:")
flag.PrintDefaults()
}
flag.Parse()
}
func main() {
path := flag.String("path", ".", "Working directory for the server.")
host := flag.String("host", "", "Name of the localhost server.")
port := flag.Int("port", 1234, "Port of the localhost server.")
initFlags()
server.AwpServer(*path, *host, int16(*port))
}