mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-01-26 17:25:23 +00:00
Subcommand serve should parse flags.
Signed-off-by: Justin Ko <justin.ko@oracle.com>
This commit is contained in:
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user