All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Omar Sandoval <osandov@fb.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: alias btrfs device delete to btrfs device remove
Date: Tue, 23 Jun 2015 17:40:39 +0200	[thread overview]
Message-ID: <20150623154038.GK6761@twin.jikos.cz> (raw)
In-Reply-To: <83c7d294299d9b66238f7369b1171c24d35b9294.1434508872.git.osandov@fb.com>

On Thu, Jun 18, 2015 at 03:07:09PM -0700, Omar Sandoval wrote:
> @@ -586,12 +606,13 @@ out:
>  const struct cmd_group device_cmd_group = {
>  	device_cmd_group_usage, NULL, {
>  		{ "add", cmd_add_dev, cmd_add_dev_usage, NULL, 0 },
> -		{ "delete", cmd_rm_dev, cmd_rm_dev_usage, NULL, 0 },
> +		{ "remove", cmd_rm_dev, cmd_rm_dev_usage, NULL, 0 },
>  		{ "scan", cmd_scan_dev, cmd_scan_dev_usage, NULL, 0 },
>  		{ "ready", cmd_ready_dev, cmd_ready_dev_usage, NULL, 0 },
>  		{ "stats", cmd_dev_stats, cmd_dev_stats_usage, NULL, 0 },
>  		{ "usage", cmd_device_usage,
>  			cmd_device_usage_usage, NULL, 0 },
> +		{ "delete", cmd_del_dev, cmd_del_dev_usage, NULL, 0 },

No need to introduce the wrappers, it's enough to add an alternative
usage string and the callback function will be the same. Also please
keep the aliased entries next to each other.

Suggestion for separate change: redefine the last argument (currently to
denote hidden commands) to be a flag set and add a new one for aliases.
That way we can automatically generate a compact help. Currently, the
device section looks like this:

    btrfs device add [options] <device> [<device>...] <path>
        Add a device to a filesystem
    btrfs device remove <device> [<device>...] <path>
        Remove a device from a filesystem
    btrfs device scan [(-d|--all-devices)|<device> [<device>...]]
        Scan devices for a btrfs filesystem
    btrfs device ready <device>
        Check device to see if it has all of its devices in cache for mounting
    btrfs device stats [-z] <path>|<device>
        Show current device IO stats. -z to reset stats afterwards.
    btrfs device usage [options] <path> [<path>..]
        Show detailed information about internal allocations in devices.
    btrfs device delete <device> [<device>...] <path>
        Remove a device from a filesystem (alias of remove)

For the first version it could be simply the first line of the usage string:

    btrfs device add [options] <device> [<device>...] <path>
        Add a device to a filesystem
    btrfs device delete <device> [<device>...] <path>
    btrfs device remove <device> [<device>...] <path>
        Remove a device from a filesystem
    btrfs device scan [(-d|--all-devices)|<device> [<device>...]]
        Scan devices for a btrfs filesystem
    btrfs device ready <device>
        Check device to see if it has all of its devices in cache for mounting
    btrfs device stats [-z] <path>|<device>
        Show current device IO stats. -z to reset stats afterwards.
    btrfs device usage [options] <path> [<path>..]
        Show detailed information about internal allocations in devices.
        Remove a device from a filesystem (alias of remove)

  reply	other threads:[~2015-06-23 15:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-18 22:07 [PATCH] btrfs-progs: alias btrfs device delete to btrfs device remove Omar Sandoval
2015-06-23 15:40 ` David Sterba [this message]
2015-06-23 21:30   ` Omar Sandoval
2015-06-24 15:49     ` David Sterba

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=20150623154038.GK6761@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=osandov@fb.com \
    /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 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.