mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 17:26:28 +00:00
Subcommand serve should parse flags.
Signed-off-by: Justin Ko <justin.ko@oracle.com>
This commit is contained in:
parent
0a409c6ccb
commit
df660d35c7
@ -28,6 +28,7 @@ func serve(args []string) {
|
||||
}
|
||||
portFlag := flags.String("port", ":8080", "Local port to serve on")
|
||||
dirFlag := flags.String("directory", ".", "Directory to serve")
|
||||
flags.Parse(args)
|
||||
|
||||
http.Handle("/", http.FileServer(http.Dir(*dirFlag)))
|
||||
log.Fatal(http.ListenAndServe(*portFlag, logRequest(http.DefaultServeMux)))
|
||||
|
Loading…
Reference in New Issue
Block a user