summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2000-02-02 02:52:06 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2000-02-02 02:52:06 +0000
commit9350f4dc640f7d48548362694a8614ae90d1b9f6 (patch)
treeefd9bf0c50bc6cc3706ee7d4ebdd0af5665774be
parentcf3b8f51eff760b82a033b2c82162c037aade510 (diff)
without a command, identify is implied
-rw-r--r--sbin/atactl/atactl.812
-rw-r--r--sbin/atactl/atactl.c21
2 files changed, 23 insertions, 10 deletions
diff --git a/sbin/atactl/atactl.8 b/sbin/atactl/atactl.8
index c2e57b53208..8a3de54e852 100644
--- a/sbin/atactl/atactl.8
+++ b/sbin/atactl/atactl.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: atactl.8,v 1.1 1999/09/21 04:58:14 csapuntz Exp $
+.\" $OpenBSD: atactl.8,v 1.2 2000/02/02 02:52:05 deraadt Exp $
.\" $NetBSD: atactl.8,v 1.5 1999/02/24 18:49:14 jwise Exp $
.\"
.\" Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -60,6 +60,14 @@ the command may require.
The following commands may be used on IDE and ATA devices. Note
that not all devices support all commands.
.Pp
+If the
+.Ar device
+is specified without a
+.Ar command ,
+the
+.Cm identify
+command is implied.
+.Pp
.Cm identify
.Pp
Identify the specified device, displaying the device's vendor, product,
@@ -121,4 +129,4 @@ command written by Jason R. Thorpe.
The
.Nm
command first appeared in
-.Nx 1.4 .
+.Ox 2.6 .
diff --git a/sbin/atactl/atactl.c b/sbin/atactl/atactl.c
index fed9f06f252..30afc348778 100644
--- a/sbin/atactl/atactl.c
+++ b/sbin/atactl/atactl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atactl.c,v 1.1 1999/09/21 04:58:14 csapuntz Exp $ */
+/* $OpenBSD: atactl.c,v 1.2 2000/02/02 02:52:05 deraadt Exp $ */
/* $NetBSD: atactl.c,v 1.4 1999/02/24 18:49:14 jwise Exp $ */
/*-
@@ -148,15 +148,20 @@ main(argc, argv)
{
int i;
- /* Must have at least: device command */
- if (argc < 3)
+ dvname = argv[1];
+ if (argc == 2) {
+ cmdname = "identify";
+ argv += 2;
+ argc -= 2;
+ } else if (argc < 3) {
usage();
+ } else {
+ /* Skip program name, get and skip device name and command. */
- /* Skip program name, get and skip device name and command. */
- dvname = argv[1];
- cmdname = argv[2];
- argv += 3;
- argc -= 3;
+ cmdname = argv[2];
+ argv += 3;
+ argc -= 3;
+ }
/*
* Open the device