]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
swapon: default to --show if nothing is requested
authorSami Kerola <kerolasa@iki.fi>
Fri, 28 Dec 2012 21:23:42 +0000 (21:23 +0000)
committerKarel Zak <kzak@redhat.com>
Wed, 9 Jan 2013 12:37:21 +0000 (13:37 +0100)
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>
sys-utils/swapon.c

index 29f7a905d9eabd7377909901133159dcfdb3e6b9..6efe482961e27e2c92b549bbc6991b9407f7839c 100644 (file)
@@ -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);