public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Roman Mamedov <rm@romanrm.net>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: btrfs-progs: -q/--quiet not accepted for "btrfs subvolume" subcommands
Date: Thu, 20 Mar 2025 02:18:02 +0100	[thread overview]
Message-ID: <20250320011802.GT32661@suse.cz> (raw)
In-Reply-To: <20250320034613.47d65814@nvm>

On Thu, Mar 20, 2025 at 03:46:13AM +0500, Roman Mamedov wrote:
> On Wed, 19 Mar 2025 23:12:56 +0100
> David Sterba <dsterba@suse.cz> wrote:
> 
> > On Tue, Dec 17, 2024 at 07:56:49PM +0500, Roman Mamedov wrote:
> > > Hello,
> > > 
> > > # btrfs --version
> > > btrfs-progs v6.6.3
> > > 
> > > # btrfs sub create --help
> > > usage: btrfs subvolume create [options] [<dest>/]<name> [[<dest2>/]<name2> ...]
> 
> ^ This line appears to instruct that there's one place to put all the options;
> so if you're looking into a documentation fix, I would suggest modifying that.

That is certainly one option to improve it. The pattern I'm following is
from git that thas the multi level subcommand structure, global and
command-specific options. If you check 'man git' there are options that
are affect e.g. pager or editor, but none of these options is mentioned
in 'git-log' manual page and the help text also omits the global
options. "git log [<options>] [<revision-range>] [[--] <path>...]"

> Like,
> 
> > > usage: btrfs [global-options] subvolume create [local-options] [<dest>/]<name> [[<dest2>/]<name2> ...]
> 
> But this looks messy. So IMO the ideal would be to just not require the
> separation and accept global options also after the subcommand name.

I see the rationale here and the goal of the command line interface is
to provide convenices, while currently forcing the global options to be
only after the 'btrfs' term is still a bit uncommon.

As long as the option names don't clash with the command options it
would be possible to extend the semantics of the current "global" to
global in the sense of "anywhere the options can appear".

The original motivation was to unify the options to one place but based
on the feedback and my own experience I think the current split is not a
good pattern. Implementing the new semantics will need a review of all
the commands if there are potential clashes but overall I agree it would
be a usability improvement in the end.

      reply	other threads:[~2025-03-20  1:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-17 14:56 btrfs-progs: -q/--quiet not accepted for "btrfs subvolume" subcommands Roman Mamedov
2025-03-19 22:12 ` David Sterba
2025-03-19 22:46   ` Roman Mamedov
2025-03-20  1:18     ` David Sterba [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=20250320011802.GT32661@suse.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=rm@romanrm.net \
    /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