summaryrefslogtreecommitdiffstats
path: root/sys-utils/swapon.c
diff options
context:
space:
mode:
authorSami Kerola2012-12-28 22:23:42 +0100
committerKarel Zak2013-01-09 13:37:21 +0100
commitd96b743f3fc1c5acb21dcfd4cb7d8ee25070b93a (patch)
tree5ee491460f0270091d954892b6fd5d82025a6f9e /sys-utils/swapon.c
parentipcs: fix spacing in summary output (diff)
downloadkernel-qcow2-util-linux-d96b743f3fc1c5acb21dcfd4cb7d8ee25070b93a.tar.gz
kernel-qcow2-util-linux-d96b743f3fc1c5acb21dcfd4cb7d8ee25070b93a.tar.xz
kernel-qcow2-util-linux-d96b743f3fc1c5acb21dcfd4cb7d8ee25070b93a.zip
swapon: default to --show if nothing is requested
Proposed-by: Karel Zak <kzak@redhat.com> References: http://www.spinics.net/lists/util-linux-ng/msg07301.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/swapon.c')
-rw-r--r--sys-utils/swapon.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys-utils/swapon.c b/sys-utils/swapon.c
index 29f7a905d..6efe48296 100644
--- a/sys-utils/swapon.c
+++ b/sys-utils/swapon.c
@@ -782,7 +782,7 @@ int main(int argc, char *argv[])
}
argv += optind;
- if (show) {
+ if (show || (!all && !numof_labels() && !numof_uuids() && *argv == NULL)) {
if (!ncolumns) {
/* default columns */
columns[ncolumns++] = COL_PATH;
@@ -795,9 +795,6 @@ int main(int argc, char *argv[])
return status;
}
- if (!all && !numof_labels() && !numof_uuids() && *argv == NULL)
- usage(stderr);
-
if (ifexists && !all)
usage(stderr);