@@ -17,8 +17,10 @@ import (
17
17
flag "github.com/spf13/pflag"
18
18
)
19
19
20
+ // VERSION is the current version
20
21
const VERSION = "v0.5.0-dev"
21
22
23
+ // NewHandler returns a new http.Handler
22
24
func NewHandler (ui * ui.UI , g * gocui.Gui ) http.Handler {
23
25
fn := func (w http.ResponseWriter , req * http.Request ) {
24
26
if err := ui .AddRequest (g , req ); err != nil {
@@ -54,6 +56,7 @@ func usage() {
54
56
fmt .Fprintf (os .Stderr , "\n Bindings:\n %s" , ui .Bindings .Help ())
55
57
}
56
58
59
+ // Version prints the version and exits
57
60
func Version () {
58
61
fmt .Fprintf (os .Stdout , "%s\n " , VERSION )
59
62
os .Exit (0 )
@@ -78,7 +81,7 @@ func main() {
78
81
flag .Usage = usage
79
82
80
83
flag .BoolVarP (& args .autoUpdate , "auto-update" , "a" , true , "Auto-updates response when fields change." )
81
- flag .StringVarP (& args .body , "body" , "b" , "Hello, World" , "Specifies the inital response body." )
84
+ flag .StringVarP (& args .body , "body" , "b" , "Hello, World" , "Specifies the initial response body." )
82
85
flag .StringVarP (& args .config , "config" , "c" , "" , "Specifies custom config path." )
83
86
flag .BoolVar (& args .corsEnabled , "cors" , false , "Enable CORS." )
84
87
flag .BoolVar (& args .corsDisplay , "cors-display" , true , "Display CORS requests." )
0 commit comments