From: Zhao Lei <zhaolei@cn.fujitsu.com>
To: <dsterba@suse.cz>
Cc: <linux-btrfs@vger.kernel.org>
Subject: RE: [PATCH 0/4] btrfs-progs: Use common function to parse unit arguments
Date: Mon, 31 Aug 2015 09:56:41 +0800 [thread overview]
Message-ID: <00ac01d0e390$48ff6fc0$dafe4f40$@cn.fujitsu.com> (raw)
In-Reply-To: <20150828172424.GG11834@twin.jikos.cz>
Hi, David Sterba
> -----Original Message-----
> From: David Sterba [mailto:dsterba@suse.cz]
> Sent: Saturday, August 29, 2015 1:24 AM
> To: Zhao Lei <zhaolei@cn.fujitsu.com>
> Cc: linux-btrfs@vger.kernel.org
> Subject: Re: [PATCH 0/4] btrfs-progs: Use common function to parse unit
> arguments
>
> On Thu, Aug 27, 2015 at 09:38:19PM +0800, Zhao Lei wrote:
> > We are using separate code for parse unit mode in current code, result
> > is each command have different argument for unit mode:
> >
> > # btrfs filesystem show --help
> > ...
> > --raw raw numbers in bytes
> > --human-readable human friendly numbers, base 1024 (default)
> > --iec use 1024 as a base (KiB, MiB, GiB, TiB)
> > --si use 1000 as a base (kB, MB, GB, TB)
> > --kbytes show sizes in KiB, or kB with --si
> > --mbytes show sizes in MiB, or MB with --si
> > --gbytes show sizes in GiB, or GB with --si
> > --tbytes show sizes in TiB, or TB with --si
> > ...
> > #
> > # btrfs filesystem df --help
> > ...
> > -b|--raw raw numbers in bytes
> > -h|--human-readable
> > human friendly numbers, base 1024 (default)
> > -H human friendly numbers, base 1000
> > --iec use 1024 as a base (KiB, MiB, GiB, TiB)
> > --si use 1000 as a base (kB, MB, GB, TB)
> > -k|--kbytes show sizes in KiB, or kB with --si
> > -m|--mbytes show sizes in MiB, or MB with --si
> > -g|--gbytes show sizes in GiB, or GB with --si
> > -t|--tbytes show sizes in TiB, or TB with --si
> > ...
> > #
> >
> > This patchset introduce common function to parse arguments for setting
> > unit: get_unit_mode_from_arg()
> > and common help message for unit argument, to make every tool in btrfs
> > have same interface for setting unit.
> >
> > The merit are:
> > 1: Unify current each tool's arguments for unit
> > 2: Make tools in future easy to implement such argument
> > 3: Changes(enhancement) in common function have effect on all
> > relative tools
>
> I like this kind of unification and code simplification. However, the 'filesystem df'
> command keeps some option compatibility with the standalone 'df' commmand
> while the other btrfs commands use only long versions of the options. So we
> have to treat 'fi df' differently and not remove the existing short options. But
> otherwise looks good, thanks.
Thanks for explain why we use short option for df.
I'll send v2.
Thanks
Zhaolei
prev parent reply other threads:[~2015-08-31 1:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-27 13:38 [PATCH 0/4] btrfs-progs: Use common function to parse unit arguments Zhao Lei
2015-08-27 13:38 ` [PATCH 1/4] btrfs-progs: Introduce get_unit_mode_from_arg for common use Zhao Lei
2015-08-27 13:38 ` [PATCH 2/4] btrfs-progs: Use common unit parser for btrfs filesystem command Zhao Lei
2015-08-27 13:38 ` [PATCH 3/4] btrfs-progs: Use common unit parser for btrfs device command Zhao Lei
2015-08-27 13:38 ` [PATCH 4/4] btrfs-progs: Use common unit parser for btrfs qgroup command Zhao Lei
2015-08-28 17:24 ` [PATCH 0/4] btrfs-progs: Use common function to parse unit arguments David Sterba
2015-08-31 1:56 ` Zhao Lei [this message]
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='00ac01d0e390$48ff6fc0$dafe4f40$@cn.fujitsu.com' \
--to=zhaolei@cn.fujitsu.com \
--cc=dsterba@suse.cz \
--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).