public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: kerolasa@iki.fi
Subject: [PATCH 3/4] swapon: default to --show if nothing is requested
Date: Fri, 28 Dec 2012 21:23:42 +0000	[thread overview]
Message-ID: <1356729823-729-3-git-send-email-kerolasa@iki.fi> (raw)
In-Reply-To: <1356729823-729-1-git-send-email-kerolasa@iki.fi>

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 | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/sys-utils/swapon.c b/sys-utils/swapon.c
index 176be42..7310767 100644
--- a/sys-utils/swapon.c
+++ b/sys-utils/swapon.c
@@ -786,7 +786,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;
@@ -799,9 +799,6 @@ int main(int argc, char *argv[])
 		return status;
 	}
 
-	if (!all && !numof_labels() && !numof_uuids() && *argv == NULL)
-		usage(stderr);
-
 	if (ifexists && !all)
 		usage(stderr);
 
-- 
1.8.0.3


  parent reply	other threads:[~2012-12-28 21:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-28 21:23 [PATCH 1/4] script: search shell from path, when necessary Sami Kerola
2012-12-28 21:23 ` [PATCH 2/4] ipcs: fix spacing in summary output Sami Kerola
2013-01-09 13:20   ` Karel Zak
2012-12-28 21:23 ` Sami Kerola [this message]
2013-01-09 13:21   ` [PATCH 3/4] swapon: default to --show if nothing is requested Karel Zak
2012-12-28 21:23 ` [PATCH 4/4] losetup: fix declarations [smatch scan] Sami Kerola
2013-01-09 13:36   ` Karel Zak
2013-01-09 12:47 ` [PATCH 1/4] script: search shell from path, when necessary Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1356729823-729-3-git-send-email-kerolasa@iki.fi \
    --to=kerolasa@iki.fi \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox