From c771a9289e38a403482fc73c7daff4c4c139a161 Mon Sep 17 00:00:00 2001 From: "Billy.Zheng" Date: Sat, 24 Aug 2024 21:40:19 +0800 Subject: [PATCH] Change myip CLI interface, will fetch ip info only from one site once. --- src/cli.cr | 28 ++++++++++++++++--- src/myip.cr | 78 +++++++++++++++++++++-------------------------------- 2 files changed, 55 insertions(+), 51 deletions(-) diff --git a/src/cli.cr b/src/cli.cr index 602135a..8923db9 100644 --- a/src/cli.cr +++ b/src/cli.cr @@ -1,9 +1,19 @@ require "option_parser" require "./myip" +ARGV << "--help" if ARGV.empty? + +ip111 = false +ip138 = false +ipsb = false + OptionParser.parse do |parser| parser.banner = <<-USAGE -Usage: myip