linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 1/4] btrfs-progs: replace filesystem show --all-devices with -d option
Date: Fri, 17 May 2013 18:54:39 +0800	[thread overview]
Message-ID: <1368788082-12090-2-git-send-email-anand.jain@oracle.com> (raw)
In-Reply-To: <1368788082-12090-1-git-send-email-anand.jain@oracle.com>

The btrfs fi show --all-devices is odd man out as compared to the
rest of the command line options with in btrfs-progs. So match it
with the btrfs-progs symantics

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 cmds-filesystem.c | 18 ++++++++++++++----
 man/btrfs.8.in    |  6 +++---
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index f41a72a..6ba27ad 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -232,7 +232,7 @@ static void print_one_uuid(struct btrfs_fs_devices *fs_devices)
 }
 
 static const char * const cmd_show_usage[] = {
-	"btrfs filesystem show [--all-devices] [<uuid>|<label>]",
+	"btrfs filesystem show [-d] [<uuid>|<label>]",
 	"Show the structure of a filesystem",
 	"If no argument is given, structure of all present filesystems is shown.",
 	NULL
@@ -248,9 +248,19 @@ static int cmd_show(int argc, char **argv)
 	int checklist = 1;
 	int searchstart = 1;
 
-	if( argc > 1 && !strcmp(argv[1],"--all-devices")){
-		checklist = 0;
-		searchstart += 1;
+	optind = 1;
+	while(1) {
+		int c = getopt(argc, argv, "d");
+		if (c < 0)
+			break;
+		switch(c) {
+		case 'd':
+			checklist = 0;
+			searchstart += 1;
+			break;
+		default:
+			usage(cmd_show_usage);
+		}
 	}
 
 	if (check_argc_max(argc, searchstart + 1))
diff --git a/man/btrfs.8.in b/man/btrfs.8.in
index 9b1f294..3d05862 100644
--- a/man/btrfs.8.in
+++ b/man/btrfs.8.in
@@ -31,7 +31,7 @@ btrfs \- control a btrfs filesystem
 .PP
 \fBbtrfs\fP \fBfilesystem label\fP\fI <dev> [newlabel]\fP
 .PP
-\fBbtrfs\fP \fBfilesystem show\fP\fI [--all-devices|<uuid>|<label>]\fP
+\fBbtrfs\fP \fBfilesystem show\fP\fI [-d] [<uuid>|<label>]\fP
 .PP
 \fBbtrfs\fP \fBfilesystem balance\fP\fI <path> \fP
 .PP
@@ -282,10 +282,10 @@ NOTE: Currently there are the following limitations:
 - the filesystem should not have more than one device.
 .TP
 
-\fBfilesystem show\fR [--all-devices|<uuid>|<label>]\fR
+\fBfilesystem show\fR [-d] [<uuid>|<label>]\fR
 Show the btrfs filesystem with some additional info. If no \fIUUID\fP or 
 \fIlabel\fP is passed, \fBbtrfs\fR show info of all the btrfs filesystem.
-If \fB--all-devices\fP is passed, all the devices under /dev are scanned;
+If \fB-d\fP is passed, all the devices under /dev are scanned;
 otherwise the devices list is extracted from the /proc/partitions file.
 .TP
 
-- 
1.8.1.227.g44fe835


  reply	other threads:[~2013-05-17 10:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-17 10:54 [PATCH 0/4] a structure for the disks scan for btrfs Anand Jain
2013-05-17 10:54 ` Anand Jain [this message]
2013-05-17 10:54 ` [PATCH 2/4] btrfs-progs: label option in btrfs filesystem show is not coded Anand Jain
2013-05-17 10:54 ` [PATCH 3/4] btrfs-progs: use /dev/mapper to find the btrfs disks Anand Jain
2013-05-17 10:54 ` [PATCH 4/4] btrfs-progs: btrfs_scan_for_fsid doesn't need all the arguments Anand Jain
2013-05-17 11:21 ` [PATCH 0/4] a structure for the disks scan for btrfs Gabriel de Perthuis
2013-05-17 11:25   ` Gabriel de Perthuis
2013-05-18  4:35   ` anand jain
2013-05-30  3:40 ` [PATCH 0/6 v2] btrfs-progs: " Anand Jain
2013-05-30  3:40   ` [PATCH 1/6 v2] btrfs-progs: btrfs_scan_for_fsid doesn't need all the arguments Anand Jain
2013-05-30  3:40   ` [PATCH 2/6 v2] btrfs-progs: label option in btrfs filesystem show is not coded Anand Jain
2013-05-30  3:40   ` [PATCH 3/6 v2] btrfs-progs: update device scan usage Anand Jain
2013-05-30  3:40   ` [PATCH 4/6 v2] btrfs-progs: congregate dev scan Anand Jain
2013-05-31  8:17     ` [PATCH 4/6 v3] " Anand Jain
2013-05-30  3:40   ` [PATCH 5/6 v2] btrfs-progs: btrfs_scan_one_dir not to skip links when /dev/mapper is provided Anand Jain
2013-05-30  3:40   ` [PATCH 6/6 v2] btrfs-progs: scan /dev/mapper in filesystem show and device scan Anand Jain

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=1368788082-12090-2-git-send-email-anand.jain@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=linux-btrfs@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;
as well as URLs for NNTP newsgroup(s).