From: Ilya Dryomov Subject: Re: [PATCH 0/3] Btrfs-progs: restriper interface Date: Sat, 4 Feb 2012 16:47:17 +0200 Message-ID: <20120204144717.GB10916@zambezi.lan> References: <1328305752-32160-1-git-send-email-idryomov@gmail.com> <201202041406.28273.kreijack@inwind.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Hugo Mills , linux-btrfs@vger.kernel.org, Chris Mason To: Goffredo Baroncelli Return-path: In-Reply-To: <201202041406.28273.kreijack@inwind.it> List-ID: On Sat, Feb 04, 2012 at 02:06:28PM +0100, Goffredo Baroncelli wrote: > Hi Ilya, > > On Friday, 03 February, 2012 22:49:09 Ilya Dryomov wrote: > > Hello, > > > > This is the userspace part of restriper, rebased onto the new progs > > infrastructure. Restriper commands are located under 'balance' prefix, > > which is now the top level command group. However to not confuse > > existing users 'balance' prefix is also available under 'filesystem': > > > > btrfs [filesystem] balance start > > btrfs [filesystem] balance pause > > btrfs [filesystem] balance cancel > > btrfs [filesystem] balance resume > > btrfs [filesystem] balance status > > > > Backwards compatibility is fully preserved thanks to the new command > > parser: the old 'btrfs filesystem balance ' works as expected. > > I prefer to avoid prefix which may confuse the user. If I have a subvolume > called "s", what means: > > btrfs filesystem balance s > > Is it a missing argument (the path required for btrfs filesystem balance) or > is it a synonymus of > > btrfs filesystem balance start ./s > > (or btrfs filesystem balance stop ./s) > > ? It's a path. It's unambiguous because every subcommand requires an argument. If you omit the path argument you get the following: btrfs-progs-new$ ./btrfs fi balance usage: btrfs [filesystem] balance [] [options] btrfs [filesystem] balance start [options] Balance chunks across the devices btrfs [filesystem] balance pause Pause running balance btrfs [filesystem] balance cancel Cancel running or paused balance btrfs [filesystem] balance resume Resume interrupted balance btrfs [filesystem] balance status [-v] Show status of running or paused balance 'btrfs filesystem balance' command is deprecated, please use 'btrfs balance start' command instead. which clearly indicates that is optional. Finally, if you type btrfs fi balance s /mnt (which is ambiguous because 's' could mean 'start' or 'status') you get the following: btrfs-progs-new$ ./btrfs fi balance s /mnt btrfs filesystem balance: ambiguous token 's' Did you mean one of these ? start status Pretty clear to me. > > To me I prefer to add another family of command called > > btrfs balance * > > and to leave > > btrfs filesystem balance > > as synonymus of > > btrfs balance start I discussed this with Chris and we agreed that it will be confusing if 'btrfs filesystem balance' is different from 'btrfs balance'. > > > This was discussed several years ago. Allowing the user to abbreviate the > commands fights with the ability to have different length of commands , when > an option could beconfused with a command (s vs start/stop....). It generally does, but in this particular case (where every subcommand in the group requires at least one argument) it does not. Thanks, Ilya