Re: [PATCH] btrfs-progs: add option to only list parent subvolumes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2017/10/01 3:17, Holger Hoffstätte wrote:
> On 09/30/17 19:56, Holger Hoffstätte wrote:
>> shell hackery as alternative. Anyway, I was sure that at the time the
>> other letters sounded even worse/were taken, but that may just have been
>> in my head. ;-)
>>
>> I just rechecked and -S is still available, so that's good.
> 
> Except that it isn't really, since there is already an 'S'
> case in cmds-subvolume.c as shortcut to --sort:
> 
> --
>         case 'S':
>             ret = btrfs_list_parse_sort_string(optarg,
>                                &comparer_set);
> --
> 
> ..which is why I picked P at the time.

Hello,

It is confusing, but the third args of getopt_long doesn't take 'S':

 445                 static const struct option long_options[] = {
 446                         {"sort", required_argument, NULL, 'S'},
 447                         {NULL, 0, NULL, 0}
 448                 };
 449 
 450                 c = getopt_long(argc, argv,
 451                                     "acdgopqsurRG:C:t", long_options, NULL);

So, you can use -S option if you change 'S' in L.446 to something.
(I'm not sure this is intended or someone forgot to add 'S'.)

> 
> Holger
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux