@@ -77,6 +77,68 @@ Options:
7777` , progBase )
7878}
7979
80+ var detailedHelp = fmt .Sprintf (`Usage: %s <cmd> [<opts>] [<args>]
81+
82+ Commands:
83+ <ip> look up details for an IP address, e.g. 8.8.8.8.
84+ <asn> look up details for an ASN, e.g. AS123 or as123.
85+ myip get details for your IP.
86+ bulk get details for multiple IPs in bulk.
87+ asn tools related to ASNs.
88+ summarize get summarized data for a group of IPs.
89+ map open a URL to a map showing the locations of a group of IPs.
90+ prips print IP list from CIDR or range.
91+ grepip grep for IPs matching criteria from any source.
92+ matchip print the overlapping IPs and subnets.
93+ grepdomain grep for domains matching criteria from any source.
94+ cidr2range convert CIDRs to IP ranges.
95+ cidr2ip convert CIDRs to individual IPs within those CIDRs.
96+ range2cidr convert IP ranges to CIDRs.
97+ range2ip convert IP ranges to individual IPs within those ranges.
98+ randip Generates random IPs.
99+ splitcidr splits a larger CIDR into smaller CIDRs.
100+ mmdb read, import and export mmdb files.
101+ calc evaluates a mathematical expression that may contain IP addresses.
102+ tool misc. tools related to IPs, IP ranges and CIDRs.
103+ download download free ipinfo database files.
104+ cache manage the cache.
105+ config manage the config.
106+ quota print the request quota of your account.
107+ init login or signup account.
108+ logout delete your current API token session.
109+ completion install or output shell auto-completion script.
110+ version show current version.
111+
112+ Options:
113+ General:
114+ --token <tok>, -t <tok>
115+ use <tok> as API token.
116+ --nocache
117+ do not use the cache.
118+ --version, -v
119+ show binary release number.
120+ --help, -h
121+ show help.
122+
123+ Outputs:
124+ --field <field>, -f <field>
125+ lookup only specific fields in the output.
126+ field names correspond to JSON keys, e.g. 'hostname' or 'company.type'.
127+ multiple field names must be separated by commas.
128+ --nocolor
129+ disable colored output.
130+
131+ Formats:
132+ --pretty, -p
133+ output pretty format.
134+ --json, -j
135+ output JSON format.
136+ --csv, -c
137+ output CSV format.
138+ --yaml, -y
139+ output YAML format.
140+ ` , progBase )
141+
80142func cmdDefault () (err error ) {
81143 var ips []net.IP
82144 var fTok string
@@ -90,7 +152,8 @@ func cmdDefault() (err error) {
90152 pflag .StringVarP (& fTok , "token" , "t" , "" , "the token to use." )
91153 pflag .BoolVar (& fNoCache , "nocache" , false , "disable the cache." )
92154 pflag .BoolVarP (& fVsn , "version" , "v" , false , "print binary release number." )
93- pflag .BoolVarP (& fHelp , "help" , "h" , false , "show help." )
155+ pflag .BoolVarP (& fHelp , "" , "h" , false , "show help." )
156+ pflag .BoolVar (& fHelpDetailed , "help" , false , "show detailed help" )
94157 pflag .StringSliceVarP (& fField , "field" , "f" , nil , "specific field to lookup." )
95158 pflag .BoolVarP (& fPretty , "pretty" , "p" , true , "output pretty format." )
96159 pflag .BoolVarP (& fJSON , "json" , "j" , true , "output JSON format. (default)" )
@@ -108,6 +171,12 @@ func cmdDefault() (err error) {
108171 return nil
109172 }
110173
174+ if fHelpDetailed {
175+ // Read the string and display it using a pager
176+ lib .HelpDetailed (detailedHelp , printHelpDefault )
177+ return nil
178+ }
179+
111180 if fVsn {
112181 fmt .Println (version )
113182 return nil
0 commit comments