-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
76 lines (53 loc) · 1.68 KB
/
main.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package main
import(
//"fmt"
//"net/http"
"github.com/stephenhu/static/cmd"
//"github.com/gorilla/mux"
)
/*
var (
cmdClean = kingpin.Command("clean", "Remove compiled html files only")
cmdCleanAll = cmdClean.Flag("all",
"Remove all compiled html and configuration files").Short('a').Bool()
cmdInit = kingpin.Command("init", "Initialize site")
cmdVersion = kingpin.Command("version", "static version")
cmdConfig = kingpin.Command("config", "static configuration")
cmdExclude = cmdConfig.Flag("exclude",
"Comma delimited list of files to exclude from compilation").Short(
'e').String()
cmdList = cmdConfig.Flag("list",
"List all configuration parameters.").Bool()
cmdTest = kingpin.Command("test",
"Starts up local http server for testing")
cmdPort = cmdTest.Flag("port",
"Port used by static server").String()
cmdCompile = kingpin.Command("compile", "Compile templates")
cmdSrc = cmdCompile.Flag(
"src", "Source file location").Short('d').String()
cmdOut = cmdCompile.Flag(
"out", "Output location").Short('o').String()
cmdForce = cmdCompile.Flag(
"force", "Overwrite if files exist?").Short('f').Bool()
)
*/
/*
func address() string {
if len(*cmdPort) == 0 {
return fmt.Sprintf("%s:%s", DEFAULT_ADDRESS, DEFAULT_PORT)
} else {
return fmt.Sprintf("%s:%s", DEFAULT_ADDRESS, *cmdPort)
}
} // address
func initRouter() *mux.Router {
router := mux.NewRouter()
router.PathPrefix("/assets").Handler(http.StripPrefix("/assets",
http.FileServer(http.Dir("."))))
router.HandleFunc("/", genericHandler)
router.HandleFunc("/{resource}", genericHandler)
return router
} // initRouter
*/
func main() {
cmd.Execute()
} // main