Skip to content

Commit 4e2b423

Browse files
committed
Fix flags
1 parent 94f2ada commit 4e2b423

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

main.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,13 @@ func main() {
196196
panic(err)
197197
}
198198

199-
path = *flag.String("path", path, "Path to serve")
200-
host := *flag.String("host", "", "Server host")
201-
port := *flag.Int("port", 8000, "Server port number")
199+
pathPtr := flag.String("path", path, "Path to serve")
200+
hostPtr := flag.String("host", "", "Server host")
201+
portPtr := flag.Int("port", 8000, "Server port number")
202202
flag.Parse()
203+
path = *pathPtr
204+
host := *hostPtr
205+
port := *portPtr
203206

204207
path, err = filepath.Abs(path)
205208
if err != nil {

0 commit comments

Comments
 (0)