Skip to content

Commit d0c648a

Browse files
committed
update argparse
1 parent c9d7da2 commit d0c648a

4 files changed

Lines changed: 15 additions & 3 deletions

File tree

‎ChangeLog.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [0.2.2] - 2021-08-11
2+
3+
### Updated
4+
5+
- update argparse version
6+
17
## [0.2.1] - 2021-05-05
28

39
### Updated

‎entry.go‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@ import (
66
)
77

88
// Version info of the program
9-
const Version = "0.2.1"
9+
const Version = "0.2.2"
1010

1111
func main() {
1212
parser := argparse.NewParser("ipinfo", "tool for ip info lookup",
1313
&argparse.ParserConfig{DisableDefaultShowHelp: true})
1414
showVersion := parser.Flag("v", "version", &argparse.Option{Help: "show version info"})
1515
target := parser.Strings("ip", "host", &argparse.Option{Positional: true, Help: "target ip/host"})
1616
if e := parser.Parse(nil); e != nil {
17-
fmt.Println(e.Error())
17+
switch e.(type) {
18+
case argparse.BreakAfterHelp:
19+
default:
20+
fmt.Println(e.Error())
21+
}
1822
return
1923
}
2024
if *showVersion {

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module github.com/hellflame/ipinfo
22

33
go 1.13
44

5-
require github.com/hellflame/argparse v0.1.1
5+
require github.com/hellflame/argparse v1.5.1

‎go.sum‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
github.com/hellflame/argparse v0.1.1 h1:V8PTyw/txNUU9PuanlVJVyTPKEQeHiNb2ODua1uuuPA=
22
github.com/hellflame/argparse v0.1.1/go.mod h1:nOtOQAtkWh6u5msq6huJxZtjb+Yg9VeN0e7vRuBS49E=
3+
github.com/hellflame/argparse v1.5.1 h1:2vyn8cMwDe8NmlBSlx7DjxuLvLoz1m06AynEhjV3J6o=
4+
github.com/hellflame/argparse v1.5.1/go.mod h1:nOtOQAtkWh6u5msq6huJxZtjb+Yg9VeN0e7vRuBS49E=

0 commit comments

Comments
 (0)
⌂ 换网址