From ce4d12970216ec13be6481267d5e4cb61674dda1 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Sat, 11 Feb 2017 02:11:18 +0100 Subject: [PATCH] [enh] add versioning (semver) --- wuzz.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/wuzz.go b/wuzz.go index ad9b64d..a04a2f6 100644 --- a/wuzz.go +++ b/wuzz.go @@ -22,6 +22,8 @@ import ( "github.com/jroimartin/gocui" ) +const VERSION = "0.1.0" + var METHODS []string = []string{ http.MethodGet, http.MethodPost, @@ -976,6 +978,10 @@ func help() { Usage: wuzz [-H|--header=HEADER]... [-d|--data=POST_DATA] [-X|--request=METHOD] [-t|--timeout=MSECS] [URL] +Other command line options: + -h, --help Show this + -v, --version Display version number + Key bindings: ctrl+r Send request ctrl+s Save response @@ -989,9 +995,13 @@ Key bindings: func main() { for _, arg := range os.Args { - if arg == "-h" || arg == "--help" { + switch arg { + case "-h", "--help": help() return + case "-v", "--version": + fmt.Printf("wuzz %v\n", VERSION) + return } } g, err := gocui.NewGui(gocui.Output256)