On Mon, Oct 18, 2010 at 09:21:56AM +0100, Frank Kingswood wrote:
> On 17/10/10 19:26, hugo-l...@carfax.org.uk wrote:
>> Change btrfs filesystem df to allow the user to control the scales
>> used for sizes in the output.
>>
>> Index: btrfs-progs-unstable/btrfs.c
>> ===================================================================
>> --- btrfs-progs-unstable.orig/btrfs.c        2010-10-17 18:43:57.000000000 
>> +0100
>> +++ btrfs-progs-unstable/btrfs.c     2010-10-17 18:47:36.000000000 +0100
>> @@ -87,9 +87,10 @@
>>              "Show the info of a btrfs filesystem. If no<uuid>  or<label>\n"
>>              "is passed, info of all the btrfs filesystem are shown."
>>      },
>> -    { do_df_filesystem, 1,
>> -      "filesystem df", "<path>\n"
>> +    { do_df_filesystem, -1,
>> +      "filesystem df", "[-r|-b|-i]<path>\n"
>>              "Show space usage information for a mount point\n."
>> +            "-r, -b, -i for raw (bytes), binary or ISO sizes."
>>      },
>
> This seems to eat up the short option namespace a bit quickly.
> Fileutils uses different names as well, it may be convenient for users to 
> match its names:
>       -h --human-readable   powers of 2**10
>       -H --si   powers of 1000

   Matching fileutils is probably a good idea. I'm happy to use -h and
-H.

>>      { do_balance, 1,
>>        "filesystem balance", "<path>\n"
>> Index: btrfs-progs-unstable/btrfs_cmds.c
>> ===================================================================
>> --- btrfs-progs-unstable.orig/btrfs_cmds.c   2010-10-17 18:43:57.000000000 
>> +0100
>> +++ btrfs-progs-unstable/btrfs_cmds.c        2010-10-17 18:47:36.000000000 
>> +0100
>> @@ -841,7 +841,36 @@
>>      u64 count = 0, i;
>>      int ret;
>>      int fd;
>> -    char *path = argv[1];
>> +    char *path;
>> +    int format = PRETTY_SIZE_BINARY;
>
> Should the default not be to show sizes in bytes ("RAW")?

   I was trying not to change the default behaviour at all, but with
-h/-H (and no switch for --raw), that would make sense. I'll re-roll
the patches. (And update the man pages, as Goffredo asked).

   Hugo.

-- 
=== Hugo Mills: h...@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
     --- "I don't like the look of it,  I tell you." "Well, stop ---     
                          looking at it, then."                          

Attachment: signature.asc
Description: Digital signature

Reply via email to