[Libguestfs] [v2v PATCH] bash: remove extra registrations

Pino Toscano ptoscano at redhat.com
Tue Mar 10 17:28:52 UTC 2020


The virt-v2v-copy-to-local completion script definitely does not need to
register completions for libguestfs-test-tool, and virt-win-reg, as they
are libguestfs tools.

Also, rename the helper _guestfs_options_only to _v2v_options_only, to
avoid potential clashes with the libguestfs completion scripts.
---
 bash/virt-v2v-copy-to-local | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/bash/virt-v2v-copy-to-local b/bash/virt-v2v-copy-to-local
index 8360b0b9..c14bbc47 100644
--- a/bash/virt-v2v-copy-to-local
+++ b/bash/virt-v2v-copy-to-local
@@ -15,7 +15,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-_guestfs_options_only ()
+_v2v_options_only ()
 {
     local cur prev words cword split
     local shortopts longopts tool="$1"
@@ -42,18 +42,6 @@ _guestfs_options_only ()
 
 _virt_v2v_copy_to_local ()
 {
-    _guestfs_options_only "virt-v2v-copy-to-local"
+    _v2v_options_only "virt-v2v-copy-to-local"
 } &&
 complete -o default -F _virt_v2v_copy_to_local virt-v2v-copy-to-local
-
-_virt_win_reg ()
-{
-    _guestfs_options_only "virt-win-reg"
-} &&
-complete -o default -F _virt_win_reg virt-win-reg
-
-_libguestfs-test-tool ()
-{
-    _guestfs_options_only "libguestfs-test-tool"
-} &&
-complete -o default -F _libguestfs-test-tool libguestfs-test-tool
-- 
2.24.1




More information about the Libguestfs mailing list