-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinit.go
53 lines (41 loc) · 969 Bytes
/
init.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
48
49
50
51
52
53
package main
import (
"flag"
"fmt"
// "io"
"os"
"time"
"log/slog"
"github.com/henvic/httpretty"
"github.com/lmittmann/tint"
"github.com/mattn/go-colorable"
)
func init() {
log = slog.New(
tint.NewHandler(colorable.NewColorableStderr(),
&tint.Options{
Level: slog.LevelDebug,
TimeFormat: time.DateTime,
},
),
)
httplog = &httpretty.Logger{
RequestHeader: true,
RequestBody: true,
Colors: true,
SkipSanitize: true,
}
opt = new(options)
flag.StringVar(&opt.Authtoken, "t", "", "")
flag.StringVar(&opt.Authtoken, "token", "", "")
flag.StringVar(&opt.Endpoint, "e", "http", "")
flag.StringVar(&opt.Endpoint, "endpoint", "http", "")
flag.BoolVar(&opt.Unstrip, "unstrip", false, "")
flag.StringVar(&opt.Output, "o", "", "")
flag.StringVar(&opt.Output, "output", "", "")
flag.Usage = func() {
fmt.Fprintf(os.Stderr, "%s%s\n", banner, usage)
}
flag.Parse()
fmt.Fprintf(os.Stderr, "%s\n", banner)
}