mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-20 07:14:26 +01:00
Bitch if both an id and a name are specified. Make the man page and usage
message reflect this. As a bonus, make the -n optional so that 'kldunload name' works as one would expect.
This commit is contained in:
parent
9b84d62900
commit
eda1fa0957
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=40981
@ -23,7 +23,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: kldunload.8,v 1.3 1998/01/05 07:10:41 charnier Exp $
|
||||
.\" $Id: kldunload.8,v 1.4 1998/03/19 07:45:32 charnier Exp $
|
||||
.\"
|
||||
.Dd April 25, 1997
|
||||
.Dt KLDUNLOAD 8
|
||||
@ -34,8 +34,10 @@
|
||||
.Sh SYNOPSIS
|
||||
.Nm kldunload
|
||||
.Op Fl v
|
||||
.Op Fl i Ar id
|
||||
.Op Fl n Ar name
|
||||
.Fl i Ar id
|
||||
.Nm kldunload
|
||||
.Op Fl v
|
||||
.Fl n Ar name
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"$Id: kldunload.c,v 1.5 1998/01/05 07:10:42 charnier Exp $";
|
||||
"$Id: kldunload.c,v 1.6 1998/07/06 06:59:52 charnier Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <err.h>
|
||||
@ -39,7 +39,8 @@ static const char rcsid[] =
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage: kldunload [-v] [-i id] [-n name]\n");
|
||||
fprintf(stderr, "usage: kldunload [-v] -i id\n");
|
||||
fprintf(stderr, " kldunload [-v] -n name\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@ -68,7 +69,12 @@ main(int argc, char** argv)
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (argc != 0)
|
||||
if (!fileid && !filename && (argc == 1)) {
|
||||
filename = *argv;
|
||||
argc--;
|
||||
}
|
||||
|
||||
if (argc != 0 || fileid && filename)
|
||||
usage();
|
||||
|
||||
if (fileid == 0 && filename == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user