mirror of
https://github.com/rfc1036/whois.git
synced 2026-08-31 07:30:22 +00:00
Move longopts into main()
This commit is contained in:
parent
ec1d53f1ba
commit
1ae06d1a5a
24
whois.c
24
whois.c
@ -71,23 +71,25 @@ int hide_discl = HIDE_DISABLED;
|
||||
|
||||
const char *client_tag = IDSTRING;
|
||||
|
||||
#ifdef HAVE_GETOPT_LONG
|
||||
static const struct option longopts[] = {
|
||||
{"version", no_argument, NULL, 1 },
|
||||
{"verbose", no_argument, NULL, 2 },
|
||||
{"help", no_argument, NULL, 3 },
|
||||
{"server", required_argument, NULL, 'h'},
|
||||
{"host", required_argument, NULL, 'h'},
|
||||
{"port", required_argument, NULL, 'p'},
|
||||
{NULL, 0, NULL, 0 }
|
||||
};
|
||||
#else
|
||||
#ifndef HAVE_GETOPT_LONG
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#ifdef HAVE_GETOPT_LONG
|
||||
const struct option longopts[] = {
|
||||
{"version", no_argument, NULL, 1 },
|
||||
{"verbose", no_argument, NULL, 2 },
|
||||
{"help", no_argument, NULL, 3 },
|
||||
{"server", required_argument, NULL, 'h'},
|
||||
{"host", required_argument, NULL, 'h'},
|
||||
{"port", required_argument, NULL, 'p'},
|
||||
{NULL, 0, NULL, 0 }
|
||||
};
|
||||
#endif
|
||||
|
||||
int ch, nopar = 0, fstringlen = 64;
|
||||
const char *server = NULL, *port = NULL;
|
||||
char *qstring, *fstring;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user