summaryrefslogtreecommitdiff
path: root/sbin/swapctl/swapctl.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-11-26 13:36:35 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-11-26 13:36:35 +0000
commit8a978ed56b75a0f4fd0602dbe656a827baeedc14 (patch)
tree10724ed6fd520333d88f6bc187fc477addb97a86 /sbin/swapctl/swapctl.c
parentb2e70517f47cbe6832a7f91cc516866c53bc2760 (diff)
if no arguments given, assume a nice default; ok miod jakemsr deanna
Diffstat (limited to 'sbin/swapctl/swapctl.c')
-rw-r--r--sbin/swapctl/swapctl.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sbin/swapctl/swapctl.c b/sbin/swapctl/swapctl.c
index 0b1c883cdf5..d89d9f48adc 100644
--- a/sbin/swapctl/swapctl.c
+++ b/sbin/swapctl/swapctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: swapctl.c,v 1.16 2007/07/17 18:26:05 jmc Exp $ */
+/* $OpenBSD: swapctl.c,v 1.17 2007/11/26 13:36:33 deraadt Exp $ */
/* $NetBSD: swapctl.c,v 1.9 1998/07/26 20:23:15 mycroft Exp $ */
/*
@@ -170,13 +170,17 @@ main(int argc, char *argv[])
}
}
- /* Did the user specify a command? */
- if (command == 0)
- usage();
-
argv += optind;
argc -= optind;
+ /* Did the user specify a command? */
+ if (command == 0) {
+ if (argc == 0)
+ SET_COMMAND(CMD_l);
+ else
+ usage();
+ }
+
switch (argc) {
case 0:
if (command & REQUIRE_PATH)
@@ -442,6 +446,6 @@ usage(void)
fprintf(stderr, " %s -a [-p priority] path\n", __progname);
fprintf(stderr, " %s -c -p priority path\n", __progname);
fprintf(stderr, " %s -d path\n", __progname);
- fprintf(stderr, " %s -l | -s [-k]\n", __progname);
+ fprintf(stderr, " %s [[-l] | -s] [-k]\n", __progname);
exit(1);
}