linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Fedyk <mfedyk@mikefedyk.com>
To: Goffredo Baroncelli <kreijack@gmail.com>
Cc: Thomas Kupper <thomas@kupper.org>,
	"Dipl.-Ing. Michael Niederle" <mniederle@gmx.at>,
	linux-btrfs@vger.kernel.org, Chris Mason <chris.mason@oracle.com>
Subject: Re: [PATCH 0/2] btrfs: a new tool to manage a btrfs filesystem
Date: Tue, 16 Feb 2010 09:31:22 -0800	[thread overview]
Message-ID: <93cdabd21002160931v27f97ef7o2d77d26205b6d1cd@mail.gmail.com> (raw)
In-Reply-To: <201002141639.32634.kreijack@libero.it>

On Sun, Feb 14, 2010 at 7:39 AM, Goffredo Baroncelli <kreijack@gmail.co=
m> 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 w=
ith the
> many of them!
>>
>> > Usage:
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 btrfs snapshot|-s <source> [<dest>/]<n=
ame>
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Create a w=
riteble snapshot of the subvolume
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <source> w=
ith the name <name> in the <dest>
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 directory.
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 btrfs delete|-D <subvolume>
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 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, "<comma=
nd>
> <action> [sub-action> <options>|<arguments] ...".
>
> Seriously, you (as also Michel and Mike) raised some concern about th=
e command
> line syntax. The main issues are:
> 1) possible mistaken between the '-d' (delete) command and '-D' (defr=
ag)
> 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 us=
e 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 :=3D { 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 =3D ip route
ip ru =3D ip rule
ip a =3D ip addr
ip l =3D 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 ren=
amed as -
> R/remove. The conflict with the -r/resize command is not a problem be=
cause 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-02-16 17:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-14 10:17 [PATCH 0/2] btrfs: a new tool to manage a btrfs filesystem Thomas Kupper
2010-02-14 12:54 ` Dipl.-Ing. Michael Niederle
2010-02-14 15:39 ` Goffredo Baroncelli
2010-02-16 17:31   ` Mike Fedyk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-02-12 19:01 Goffredo Baroncelli
2010-02-12 19:32 ` Mike Fedyk

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=93cdabd21002160931v27f97ef7o2d77d26205b6d1cd@mail.gmail.com \
    --to=mfedyk@mikefedyk.com \
    --cc=chris.mason@oracle.com \
    --cc=kreijack@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mniederle@gmx.at \
    --cc=thomas@kupper.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).