All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 1/2] btrfs-progs: completion: Use _filedir() to replace _btrfs_devs()
Date: Tue, 17 Jul 2018 14:15:31 +0800	[thread overview]
Message-ID: <20180717061532.11857-2-wqu@suse.com> (raw)
In-Reply-To: <20180717061532.11857-1-wqu@suse.com>

For developers it's pretty common to call "btrfs check" on a raw image
dump other than real block device.

So current _btrfs_devs() is really making things worse. Use _filedir()
to replace _btrfs_devs() so it can complete any filenames, no matter if
it's just a file or a real block device.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 btrfs-completion | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/btrfs-completion b/btrfs-completion
index ae683f4ecf61..33830e827977 100644
--- a/btrfs-completion
+++ b/btrfs-completion
@@ -6,9 +6,7 @@
 
 _btrfs_devs()
 {
-	local DEVS
-	DEVS=''; while read dev; do DEVS+="$dev "; done < <(lsblk -pnro name)
-	COMPREPLY+=( $( compgen -W "$DEVS" -- "$cur" ) )
+	_filedir
 }
 
 _btrfs_mnts()
-- 
2.18.0


  reply	other threads:[~2018-07-17  6:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-17  6:15 [PATCH 0/2] btrfs-progs: completion: Small fixes to make debug simpler Qu Wenruo
2018-07-17  6:15 ` Qu Wenruo [this message]
2018-08-03 14:00   ` [PATCH 1/2] btrfs-progs: completion: Use _filedir() to replace _btrfs_devs() David Sterba
2018-08-03 14:04     ` Qu Wenruo
2018-07-17  6:15 ` [PATCH 2/2] btrfs-progs: completion: Let dump-tree/dump-super/inode-resolve to accept any file Qu Wenruo
2018-07-31  1:47 ` [PATCH 0/2] btrfs-progs: completion: Small fixes to make debug simpler Misono Tomohiro

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=20180717061532.11857-2-wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.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 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.