Btrfs-Progs: update '-s' option without a argument.
authorWang Shilong <wangsl-fnst@cn.fujistu.com>
Thu, 27 Sep 2012 17:33:01 +0000 (01:33 +0800)
committerroot <root@localhost.localdomain>
Thu, 4 Oct 2012 20:26:33 +0000 (16:26 -0400)
Since '--sort' options was given ,and we can list snapshots in generation
order by --sort=+/-gen to replace '-s [0|1]' totally.

Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujistsu.com>
cmds-subvolume.c
man/btrfs.8.in

index 3b4edb6..58e8983 100644 (file)
@@ -260,7 +260,7 @@ static int cmd_subvol_delete(int argc, char **argv)
 }
 
 static const char * const cmd_subvol_list_usage[] = {
-       "btrfs subvolume list [-apurt] [-s 0|1] [-g [+|-]value] [-c [+|-]value] "
+       "btrfs subvolume list [-apurts] [-g [+|-]value] [-c [+|-]value] "
        "[--sort=gen,ogen,rootid,path] <path>",
        "List subvolumes (and snapshots)",
        "",
@@ -268,8 +268,7 @@ static const char * const cmd_subvol_list_usage[] = {
        "-a           print all the subvolumes in the filesystem.",
        "-u           print the uuid of subvolumes (and snapshots)",
        "-t           print the result as a table",
-       "-s value     list snapshots with generation in ascending/descending order",
-       "             (1: ascending, 0: descending)",
+       "-s           list snapshots only in the filesystem",
        "-r           list readonly subvolumes (including snapshots)",
        "-g [+|-]value",
        "             filter the subvolumes by generation",
@@ -292,7 +291,6 @@ static int cmd_subvol_list(int argc, char **argv)
        int fd;
        u64 top_id;
        int ret;
-       int order;
        int c;
        char *subvol;
        int is_tab_result = 0;
@@ -308,7 +306,7 @@ static int cmd_subvol_list(int argc, char **argv)
        optind = 1;
        while(1) {
                c = getopt_long(argc, argv,
-                                   "aps:urg:c:t", long_options, NULL);
+                                   "apsurg:c:t", long_options, NULL);
                if (c < 0)
                        break;
 
@@ -323,13 +321,9 @@ static int cmd_subvol_list(int argc, char **argv)
                        is_tab_result = 1;
                        break;
                case 's':
-                       order = atoi(optarg);
                        btrfs_list_setup_filter(&filter_set,
                                                BTRFS_LIST_FILTER_SNAPSHOT_ONLY,
                                                0);
-                       btrfs_list_setup_comparer(&comparer_set,
-                                                 BTRFS_LIST_COMP_OGEN,
-                                                 !order);
                        btrfs_list_setup_print_column(BTRFS_LIST_OGENERATION);
                        btrfs_list_setup_print_column(BTRFS_LIST_OTIME);
 
index 632802a..6d6c70a 100644 (file)
@@ -11,7 +11,7 @@ btrfs \- control a btrfs filesystem
 .PP
 \fBbtrfs\fP \fBsubvolume create\fP\fI [<dest>/]<name>\fP
 .PP
-\fBbtrfs\fP \fBsubvolume list\fP\fI [-aprt] [-s 0|1] [-g [+|-]value] [-c [+|-]value] [--rootid=rootid,gen,ogen,path] <path>\fP
+\fBbtrfs\fP \fBsubvolume list\fP\fI [-aprts] [-g [+|-]value] [-c [+|-]value] [--rootid=rootid,gen,ogen,path] <path>\fP
 .PP
 \fBbtrfs\fP \fBsubvolume set-default\fP\fI <id> <path>\fP
 .PP
@@ -108,7 +108,7 @@ Create a subvolume in \fI<dest>\fR (or in the current directory if
 \fI<dest>\fR is omitted).
 .TP
 
-\fBsubvolume list\fR\fI [-aprt][-s 0|1] [-g [+|-]value] [-c [+|-]value] [--sort=gen,ogen,rootid,path] <path>\fR
+\fBsubvolume list\fR\fI [-aprts][-g [+|-]value] [-c [+|-]value] [--sort=gen,ogen,rootid,path] <path>\fR
 .RS
 List the subvolumes present in the filesystem \fI<path>\fR. For every
 subvolume the following information is shown by default.