On Sun, Feb 14, 2010 at 7:39 AM, Goffredo Baroncelli <kreij...@gmail.com> wrote:
> Hi all,
>
> On Sunday 14 February 2010, Thomas Kupper wrote:
>> Hi Goffredo,
>>
>> Great work! It is indeed much easier to work with one tool instead with the
> many of them!
>>
>> > Usage:
>> >         btrfs snapshot|-s <source> [<dest>/]<name>
>> >                 Create a writeble snapshot of the subvolume
>> >                 <source> with the name <name> in the <dest>
>> >                 directory.
>> >         btrfs delete|-D <subvolume>
>> >                 Delete the subvolume <subvolume>.
>>
>>
>> I backup up Mike on the opinion that the short options aren't what I would
> expect. Personally I'd prefer a command line syntax like git, "<command>
> <action> [sub-action> <options>|<arguments] ...".
>
> Seriously, you (as also Michel and Mike) raised some concern about the command
> line syntax. The main issues are:
> 1) possible mistaken between the '-d' (delete) command and '-D' (defrag)
> command. It was suggested to remove the short form command.
> 2) some commands are not very auto-explainant
>
> Regarding the point #1, I am against about removing the short command ('-
> s'...). If someone fears to mistake, he has the option to use the log form
> command. But I don't see any reason to force all others peoples to use the
> long form command.

The problem here is maintainability of scripts when people use the
short names.  I will refer to the "ip" command used in linux
networking.

It has these subcommands:
where  OBJECT := { link | addr | addrlabel | route | rule | neigh |
ntable | tunnel |
                   maddr | mroute | monitor | xfrm }

Which are listed here:

ip link
ip addr
ip addrlabel
ip route
ip rule
ip neigh
ip ntable
ip tunnel
ip maddr
ip mroute
ip monitor
ip xfrm

You can shorten them as long as they are not ambiguous:

ip ro = ip route
ip ru = ip rule
ip a = ip addr
ip l = ip link

Those are the ones I used most personally.

There are no equivalent short options, and you don't have different
sets of people using different commands in scripts and howtos for
instance.  It builds a common base of knowledge and is easy to type
from memory.

Commands that document themselves are good IMO.

ip route replace default via 1.2.3.4

Replace or set the current default to ip address 1.2.3.4 (the tool
makes sure 1.2.3.4 is reachable by an already existing route and looks
up the layer 2 address for that ip.

It's not "ip -r default -d 1.2.3.4"

Now someone reading a howto or script with that hypothetical command
will have to find out if -r is route or -R is rule.  This is how the
btrfs commands currently look to me.

> If there is an agreement I am open to rename the command "-D/delete" in order
> to reduce the conflict. For examples the -D/delete command may be renamed as -
> R/remove. The conflict with the -r/resize command is not a problem because the
> former requires 1 arguments, the latter two. Another renaming option may be -
> E/erase.
>

This just illustrates my point.  Btrfs has a rich feature set and the
short option formats are only going to create more confusion because
some of them will only be usable with a subset of operations and there
will be so many things you can do with btrfs that explicit long
options are needed to make it clear even to yourself what it does 6
months later.

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

Reply via email to