All of lore.kernel.org
 help / color / mirror / Atom feed
* btrfs-progs confusing message
@ 2016-04-20 20:23 Konstantin Svist
  2016-04-21 11:02 ` Austin S. Hemmelgarn
  0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Svist @ 2016-04-20 20:23 UTC (permalink / raw)
  To: linux-btrfs

Pretty much all commands print out the usage message when no device is
specified:

[root@host ~]# btrfs scrub start
btrfs scrub start: too few arguments
usage: btrfs scrub start [-BdqrRf] [-c ioprio_class -n ioprio_classdata]
<path>|<device>
...

However, balance doesn't

[root@host ~]# btrfs balance start
ERROR: can't access 'start': No such file or directory





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: btrfs-progs confusing message
  2016-04-20 20:23 btrfs-progs confusing message Konstantin Svist
@ 2016-04-21 11:02 ` Austin S. Hemmelgarn
  2016-04-21 16:53   ` Konstantin Svist
  0 siblings, 1 reply; 3+ messages in thread
From: Austin S. Hemmelgarn @ 2016-04-21 11:02 UTC (permalink / raw)
  To: Konstantin Svist, linux-btrfs

On 2016-04-20 16:23, Konstantin Svist wrote:
> Pretty much all commands print out the usage message when no device is
> specified:
>
> [root@host ~]# btrfs scrub start
> btrfs scrub start: too few arguments
> usage: btrfs scrub start [-BdqrRf] [-c ioprio_class -n ioprio_classdata]
> <path>|<device>
> ...
>
> However, balance doesn't
>
> [root@host ~]# btrfs balance start
> ERROR: can't access 'start': No such file or directory

And this is an example of why backwards comparability can be a pain. 
The original balance command was 'btrfs filesystem balance', and had no 
start, stop, or similar sub-commands.  This got changed to the current 
incarnation when the support for filters was added.  For backwards 
compatibility reasons, we decided to still accept balance with no 
arguments other than the path as being the same as running 'btrfs 
balance start' on that path, and then made the old name an alias to the 
new one, with the restriction that you can't pass in filters through 
that interface.  What is happening here is that balance is trying to 
interpret start as a path, not a command, hence the message about not 
being able to access 'start'.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: btrfs-progs confusing message
  2016-04-21 11:02 ` Austin S. Hemmelgarn
@ 2016-04-21 16:53   ` Konstantin Svist
  0 siblings, 0 replies; 3+ messages in thread
From: Konstantin Svist @ 2016-04-21 16:53 UTC (permalink / raw)
  To: Austin S. Hemmelgarn, linux-btrfs

On 04/21/2016 04:02 AM, Austin S. Hemmelgarn wrote:
> On 2016-04-20 16:23, Konstantin Svist wrote:
>> Pretty much all commands print out the usage message when no device is
>> specified:
>>
>> [root@host ~]# btrfs scrub start
>> btrfs scrub start: too few arguments
>> usage: btrfs scrub start [-BdqrRf] [-c ioprio_class -n ioprio_classdata]
>> <path>|<device>
>> ...
>>
>> However, balance doesn't
>>
>> [root@host ~]# btrfs balance start
>> ERROR: can't access 'start': No such file or directory
>
> And this is an example of why backwards comparability can be a pain.
> The original balance command was 'btrfs filesystem balance', and had
> no start, stop, or similar sub-commands.  This got changed to the
> current incarnation when the support for filters was added.  For
> backwards compatibility reasons, we decided to still accept balance
> with no arguments other than the path as being the same as running
> 'btrfs balance start' on that path, and then made the old name an
> alias to the new one, with the restriction that you can't pass in
> filters through that interface.  What is happening here is that
> balance is trying to interpret start as a path, not a command, hence
> the message about not being able to access 'start'.
>

So since this is still detected as an error, why not print usage info at
this point?



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-21 16:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-20 20:23 btrfs-progs confusing message Konstantin Svist
2016-04-21 11:02 ` Austin S. Hemmelgarn
2016-04-21 16:53   ` Konstantin Svist

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.