diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-10-17 18:58:25 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-10-17 18:58:25 +0000 |
commit | 8e00c60cbbae185d37142e3965f2d6cc9e1250b9 (patch) | |
tree | bea0d176311b7a65a6c49d88efb7b695d901bcbe /usr.sbin/acpidump | |
parent | 8025221b7f59f3e5bccbedc1fa93774e0a3041e7 (diff) |
fix getopt handling; ok marco
Diffstat (limited to 'usr.sbin/acpidump')
-rw-r--r-- | usr.sbin/acpidump/acpidump.8 | 8 | ||||
-rw-r--r-- | usr.sbin/acpidump/acpidump.c | 23 |
2 files changed, 10 insertions, 21 deletions
diff --git a/usr.sbin/acpidump/acpidump.8 b/usr.sbin/acpidump/acpidump.8 index 9c34e6fed7b..22c32eb65d4 100644 --- a/usr.sbin/acpidump/acpidump.8 +++ b/usr.sbin/acpidump/acpidump.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: acpidump.8,v 1.6 2007/05/31 19:20:21 jmc Exp $ +.\" $OpenBSD: acpidump.8,v 1.7 2007/10/17 18:58:23 deraadt Exp $ .\" .\" Copyright (c) 1999 Doug Rabson <dfr@FreeBSD.org> .\" Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@FreeBSD.org> @@ -29,7 +29,7 @@ .\" .\" $FreeBSD: src/usr.sbin/acpi/acpidump/acpidump.8,v 1.9 2001/09/05 19:21:25 dd Exp $ .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: October 17 2007 $ .Dt ACPIDUMP 8 .Os .Sh NAME @@ -37,8 +37,6 @@ .Nd dump ACPI tables .Sh SYNOPSIS .Nm -.Op Fl h -.Nm .Op Fl f Ar dsdt_file_for_input .Nm .Op Fl o Ar prefix_for_output @@ -116,8 +114,6 @@ The following options are supported by Interpret AML data in DSDT from a file specified in .Ar dsdt_file_for_input and dumps them in ASL to standard output. -.It Fl h -Display usage and exit. .It Fl o Ar prefix_for_output Additionally store ACPI tables from physical memory into files specified by .Ar prefix_for_output . diff --git a/usr.sbin/acpidump/acpidump.c b/usr.sbin/acpidump/acpidump.c index e693b07a4e5..8c02207d60e 100644 --- a/usr.sbin/acpidump/acpidump.c +++ b/usr.sbin/acpidump/acpidump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpidump.c,v 1.2 2005/07/21 16:38:55 fgsch Exp $ */ +/* $OpenBSD: acpidump.c,v 1.3 2007/10/17 18:58:24 deraadt Exp $ */ /*- * Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@FreeBSD.org> * All rights reserved. @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: acpidump.c,v 1.2 2005/07/21 16:38:55 fgsch Exp $ + * $Id: acpidump.c,v 1.3 2007/10/17 18:58:24 deraadt Exp $ * $FreeBSD: src/usr.sbin/acpi/acpidump/acpidump.c,v 1.3 2000/11/08 02:37:00 iwasaki Exp $ */ @@ -68,35 +68,28 @@ asl_dump_from_devmem() } static void -usage(const char *progname) +usage(void) { - printf("usage:\t%s [-o dsdt_file_for_output]\n", progname); - printf("\t%s [-f dsdt_file_for_input]\n", progname); - printf("\t%s [-h]\n", progname); + printf("usage: acpidump [-o dsdt_file_for_output]\n"); + printf(" acpidump [-f dsdt_file_for_input]\n"); exit(1); } int main(int argc, char *argv[]) { - char c, *progname; + char c; - progname = argv[0]; - while ((c = getopt(argc, argv, "f:o:h")) != -1) { + while ((c = getopt(argc, argv, "f:o:")) != -1) { switch (c) { case 'f': asl_dump_from_file(optarg); return (0); case 'o': aml_dumpfile = optarg; - break; - case 'h': - usage(progname); - break; default: - argc -= optind; - argv += optind; + usage(); } } |