mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 13:22:48 +00:00
Make arp command actually behave as documented with the addition of a -f
flag. The getopt handling in here is actually pretty bogus (not Phil's fault - it's original sin) but the general approach is working so I'm not going to break it. Some small tweaks of my own to add error checking to what was originally submitted. Strange how nobody noticed that the flag was documented but completely missing from the code before! [jkh]. Submitted by: Phil Taylor <phil@zipmail.co.uk>
This commit is contained in:
parent
f7c6335f2f
commit
95319e1733
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=9874
@ -83,7 +83,7 @@ main(argc, argv)
|
||||
int ch;
|
||||
|
||||
pid = getpid();
|
||||
while ((ch = getopt(argc, argv, "ands")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "andfs")) != EOF)
|
||||
switch((char)ch) {
|
||||
case 'a':
|
||||
dump(0);
|
||||
@ -100,6 +100,11 @@ main(argc, argv)
|
||||
if (argc < 4 || argc > 7)
|
||||
usage();
|
||||
exit(set(argc-2, &argv[2]) ? 1 : 0);
|
||||
case 'f' :
|
||||
if (argc != 3)
|
||||
usage();
|
||||
file(argv[2]);
|
||||
exit(0);
|
||||
case '?':
|
||||
default:
|
||||
usage();
|
||||
|
Loading…
Reference in New Issue
Block a user