Slackware-currentでLibvirtとbashを完了する:ドメインが完了していないのはなぜですか?

Slackware-currentでLibvirtとbashを完了する:ドメインが完了していないのはなぜですか?

Slackware-currentでは、状況は非常に奇妙です。 libvirt-6.8.0 ソースコードにコンパイルします。

Bashの完成を始めましょう。

virst st<TAB>
virsh start OK

virsh start --dom<TAB>
virsh start --domain OK

virsh start --domain <TAB>
Display all 235 possibilities? (y or n)

235の可能性?私は15個のドメインのみを構成し、235個のファイルは自宅の私のファイルとディレクトリです。 bash完了ではドメインリストを完了できないようです。他のコマンド(virsh domiflist、virsh dominfo、virsh domifaddr)はタブ補完でうまく機能します。すべての予想フィールドのリストです。すべてのlibvirtファイルを削除してlibvirtを再インストールしてみましたが、何もありませんでした...なぜ私のドメインbashが完了しないのですか?

bash デバッグを試みました。

set -x

コマンドの実行

virsh start --domain ce<TAB>

+ local flag_all=1 array ret a b ifaces nwfilters files
+ COMPREPLY=()
+ cur=cen
+ prev=--domain
+++ virsh -h
+++ grep '^    '
+++ cut '-d ' -f5
+++ virsh -h
+++ cut -d= -f1
+++ grep '\--'
+++ cut '-d ' -f7
++ echo '-c
-d
-e
-h
-k

-K

-l
-q
-r
-t
-v
-V

attach-device
attach-disk
...
very long list of virsh commands
cd
echo
exit
help
pwd
quit
connect' '--connect
--debug
--escape
--help
--keepalive-interval
--keepalive-count
--log
--quiet
--readonly
--timing'
+ cmds='-c
-d
-e
-h
-k

-K

-l
-q
-r
-t
-v
-V

attach-device
...
very long list of virsh commands
echo
exit
help
pwd
quit
connect --connect
--debug
--escape
--help
--keepalive-interval
--keepalive-count
--log
--quiet
--readonly
--timing'
++ virsh help
++ grep '^    '
++ cut '-d ' -f5
+ cmds_help='attach-device
attach-disk
attach-interface
autostart
blkdeviotune
blkiotune
blockcommit
...very long list of virsh commands
cd
echo
exit
help
pwd
quit
connect'
+ case "$prev" in
++ _virsh_list_domains 1
++ local flag_all=1 flags
++ '[' 1 -eq 1 ']'
++ flags=--all
++ virsh -q list --all
++ cut '-d ' -f7
++ awk '{print $1}'
+ doms=
+ COMPREPLY=($(compgen -W "$doms" -- "$cur"))
++ compgen -W '' -- cen
+ return 0

ベストアンサー1

解決策を見つけてください。 libvirtの読み込みが完了したようです。

/usr/share/bash-completion/completions/vsh

しかし、「侵入者」の古いファイルを読み込んでいます。/etc/bash_completion.d/virsh_bash_completion

このファイルを/etc/bash_completion.d/virsh_bash_completionにコピーする問題を修正しました。

sudo cp  /usr/share/bash-completion/completions/vsh /etc/bash_completion.d/virsh_bash_completion

今、すべてがうまくいきます。

おすすめ記事