Imported Upstream version 1.4.16+git20130910
This commit is contained in:
parent
e70fb8c051
commit
96678a79c9
28 changed files with 6224 additions and 3446 deletions
|
@ -454,6 +454,14 @@ main(int argc, char **argv)
|
|||
/* Parse extra opts if any */
|
||||
argv=np_extra_opts(&argc, argv, progname);
|
||||
|
||||
/* support "--help" and "--version" */
|
||||
if(argc == 2) {
|
||||
if(!strcmp(argv[1], "--help"))
|
||||
strcpy(argv[1], "-h");
|
||||
if(!strcmp(argv[1], "--version"))
|
||||
strcpy(argv[1], "-V");
|
||||
}
|
||||
|
||||
/* parse the arguments */
|
||||
for(i = 1; i < argc; i++) {
|
||||
while((arg = getopt(argc, argv, "vhVw:c:n:p:t:H:s:i:b:I:l:m:")) != EOF) {
|
||||
|
@ -472,7 +480,6 @@ main(int argc, char **argv)
|
|||
usage_va("ICMP data length must be between: %d and %d",
|
||||
sizeof(struct icmp) + sizeof(struct icmp_ping_data),
|
||||
MAX_PING_DATA - 1);
|
||||
|
||||
break;
|
||||
case 'i':
|
||||
pkt_interval = get_timevar(optarg);
|
||||
|
@ -512,12 +519,12 @@ main(int argc, char **argv)
|
|||
case 's': /* specify source IP address */
|
||||
set_source_ip(optarg);
|
||||
break;
|
||||
case 'V': /* version */
|
||||
print_revision (progname, NP_VERSION);
|
||||
exit (STATE_OK);
|
||||
case 'h': /* help */
|
||||
print_help ();
|
||||
exit (STATE_OK);
|
||||
case 'V': /* version */
|
||||
print_revision (progname, NP_VERSION);
|
||||
exit (STATE_OK);
|
||||
case 'h': /* help */
|
||||
print_help ();
|
||||
exit (STATE_OK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue