linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] btrfs-progs: upcase filter options
@ 2012-10-09 16:27 David Sterba
  2012-10-09 16:27 ` [PATCH 2/4] btrfs-progs: add option g to show generation, do not show it by default David Sterba
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Sterba @ 2012-10-09 16:27 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Rename filter options in 'subvol list' subcommand, that way we can
distinguish them from the options that just show some option in the
output and can have a matching uppercase filter.

Signed-off-by: David Sterba <dsterba@suse.cz>
---
 cmds-subvolume.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index ac39f7b..61be38a 100644
--- a/cmds-subvolume.c
+++ b/cmds-subvolume.c
@@ -271,8 +271,13 @@ out:
 	return ret;
 }
 
+/*
+ * Naming of options:
+ * - uppercase for filters and sort options
+ * - lowercase for enabling specific items in the output
+ */
 static const char * const cmd_subvol_list_usage[] = {
-	"btrfs subvolume list [-apurts] [-g [+|-]value] [-c [+|-]value] "
+	"btrfs subvolume list [-apurts] [-G [+|-]value] [-C [+|-]value] "
 	"[--sort=gen,ogen,rootid,path] <path>",
 	"List subvolumes (and snapshots)",
 	"",
@@ -282,10 +287,10 @@ static const char * const cmd_subvol_list_usage[] = {
 	"-t           print the result as a table",
 	"-s           list snapshots only in the filesystem",
 	"-r           list readonly subvolumes (including snapshots)",
-	"-g [+|-]value",
+	"-G [+|-]value",
 	"             filter the subvolumes by generation",
 	"             (+value: >= value; -value: <= value; value: = value)",
-	"-c [+|-]value",
+	"-C [+|-]value",
 	"             filter the subvolumes by ogeneration",
 	"             (+value: >= value; -value: <= value; value: = value)",
 	"--sort=gen,ogen,rootid,path",
@@ -318,7 +323,7 @@ static int cmd_subvol_list(int argc, char **argv)
 	optind = 1;
 	while(1) {
 		c = getopt_long(argc, argv,
-				    "apsurg:c:t", long_options, NULL);
+				    "apsurG:C:t", long_options, NULL);
 		if (c < 0)
 			break;
 
@@ -345,7 +350,7 @@ static int cmd_subvol_list(int argc, char **argv)
 		case 'r':
 			flags |= BTRFS_ROOT_SUBVOL_RDONLY;
 			break;
-		case 'g':
+		case 'G':
 			btrfs_list_setup_print_column(BTRFS_LIST_GENERATION);
 			ret = btrfs_list_parse_filter_string(optarg,
 							&filter_set,
@@ -354,7 +359,7 @@ static int cmd_subvol_list(int argc, char **argv)
 				usage(cmd_subvol_list_usage);
 			break;
 
-		case 'c':
+		case 'C':
 			btrfs_list_setup_print_column(BTRFS_LIST_OGENERATION);
 			ret = btrfs_list_parse_filter_string(optarg,
 							&filter_set,
-- 
1.7.6.233.gd79bc


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-09 16:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-09 16:27 [PATCH 1/4] btrfs-progs: upcase filter options David Sterba
2012-10-09 16:27 ` [PATCH 2/4] btrfs-progs: add option g to show generation, do not show it by default David Sterba
2012-10-09 16:27 ` [PATCH 3/4] btrfs-progs: add option c to show ogeneration David Sterba
2012-10-09 16:27 ` [PATCH 4/4] btrfs-progs: update man pages of subvol list David Sterba

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).