File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import (
36
36
const version = "0.0.2"
37
37
38
38
var (
39
+ ver bool
39
40
form bool
40
41
pretty bool
41
42
download bool
55
56
)
56
57
57
58
func init () {
59
+ flag .BoolVar (& ver , "v" , false , "Print Version Number" )
58
60
flag .BoolVar (& pretty , "pretty" , true , "Print Json Pretty Fomat" )
59
61
flag .BoolVar (& pretty , "p" , true , "Print Json Pretty Fomat" )
60
62
flag .StringVar (& printV , "print" , "A" , "Print request and response" )
@@ -82,6 +84,10 @@ func main() {
82
84
if len (args ) > 0 {
83
85
args = filter (args )
84
86
}
87
+ if ver {
88
+ fmt .Println ("Version:" , version )
89
+ os .Exit (2 )
90
+ }
85
91
if printV != "A" && printV != "B" {
86
92
defaultSetting .DumpBody = false
87
93
}
@@ -313,6 +319,7 @@ flags:
313
319
"B" request body
314
320
"h" response headers
315
321
"b" response body
322
+ -v Show Version Number
316
323
METHOD:
317
324
bat defaults to either GET (if there is no request data) or POST (with request data).
318
325
You can’t perform that action at this time.
0 commit comments