From 8a978ed56b75a0f4fd0602dbe656a827baeedc14 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Mon, 26 Nov 2007 13:36:35 +0000 Subject: if no arguments given, assume a nice default; ok miod jakemsr deanna --- usr.bin/mixerctl/mixerctl.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'usr.bin/mixerctl') diff --git a/usr.bin/mixerctl/mixerctl.c b/usr.bin/mixerctl/mixerctl.c index 887105bc60d..a10b8d47e62 100644 --- a/usr.bin/mixerctl/mixerctl.c +++ b/usr.bin/mixerctl/mixerctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mixerctl.c,v 1.25 2007/09/27 21:55:54 sobrado Exp $ */ +/* $OpenBSD: mixerctl.c,v 1.26 2007/11/26 13:36:34 deraadt Exp $ */ /* $NetBSD: mixerctl.c,v 1.11 1998/04/27 16:55:23 augustss Exp $ */ /* @@ -282,7 +282,6 @@ main(int argc, char **argv) case 't': tflag = 1; break; - case '?': default: usage(); } @@ -290,6 +289,9 @@ main(int argc, char **argv) argc -= optind; argv += optind; + if (argc == 0 && tflag == 0) + aflag++; + if ((fd = open(file, O_RDWR)) == -1) if ((fd = open(file, O_RDONLY)) == -1) err(1, "%s", file); @@ -400,7 +402,7 @@ usage(void) extern char *__progname; /* from crt0.o */ fprintf(stderr, - "usage: %s [-nv] [-f file] -a\n" + "usage: %s [-anv] [-f file]\n" " %s [-nv] [-f file] name ...\n" " %s [-qt] [-f file] name ...\n" " %s [-q] [-f file] name=value ...\n", -- cgit v1.2.3