We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c771a92 commit 0e5a773Copy full SHA for 0e5a773
src/cli.cr
@@ -7,15 +7,16 @@ ip111 = false
7
ip138 = false
8
ipsb = false
9
10
-OptionParser.parse do |parser|
11
- parser.banner = <<-USAGE
+usage = <<-USAGE
12
Usage:
13
myip ip111 => get ip from http://www.ip111.cn
14
myip ip138 => get ip info from https://www.ip138.com
15
myip ipsb => get ip info from https://api.ip.sb/geoip
16
17
USAGE
18
+OptionParser.parse do |parser|
19
+ parser.banner = usage
20
parser.on("-h", "--help", "Show this help message and exit") do
21
puts parser
22
exit
@@ -45,6 +46,8 @@ USAGE
45
46
ip138 = true
47
elsif args.includes? "ipsb"
48
ipsb = true
49
+ else
50
+ STDERR.puts usage
51
end
52
53
0 commit comments