Cleanup logging
This commit is contained in:
8
main.go
8
main.go
@@ -13,15 +13,13 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
// log.SetFlags(log.Lshortfile)
|
||||
// flag.Int("port", 4912, "Port to run server/client on.")
|
||||
// addr := flag.String("a", "127.0.0.1", "address to connect to.")
|
||||
isServer := flag.Bool("s", false, "Run netgiv in server mode")
|
||||
|
||||
// client mode flags
|
||||
isList := flag.Bool("l", false, "Set if requesting a list")
|
||||
isSend := flag.Bool("c", false, "sending stdin to netgiv server (copy)")
|
||||
isReceive := flag.Bool("p", false, "receive file from netgiv server to stdout (paste)")
|
||||
debug := flag.Bool("debug", false, "turn on debug logging")
|
||||
flag.String("address", "", "IP address/hostname of the netgiv server")
|
||||
|
||||
helpConfig := flag.Bool("help-config", false, "Show help on netgiv configuration")
|
||||
@@ -102,6 +100,10 @@ environment variable. This may be preferable in some environments.
|
||||
|
||||
}
|
||||
|
||||
if *debug {
|
||||
log.SetLevel(log.DebugLevel)
|
||||
}
|
||||
|
||||
if *isServer {
|
||||
s := Server{port: port, authToken: authtoken}
|
||||
s.Run()
|
||||
|
||||
Reference in New Issue
Block a user