[PATCH 3/6] bash-completion: Run virsh/virt-admin in quiet mode

Michal Privoznik posted 6 patches 3 months, 3 weeks ago
[PATCH 3/6] bash-completion: Run virsh/virt-admin in quiet mode
Posted by Michal Privoznik 3 months, 3 weeks ago
In some cases (e.g. when virt-admin connects to the default URI)
some info message is printed onto stdout (using vshPrintExtra()).
This hurts user experience, just consider:

  virt-admin<TAB><TAB>
  NOTE\:\ Connecting\ to\ default\ daemon.\ Specify\ daemon\ using\ -c\ \(e.g.\ virtqemud\:///system\)

when no daemon is running. Suppress extra prints by passing '-q'
in the bash-completion script.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 tools/bash-completion/vsh.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/bash-completion/vsh.in b/tools/bash-completion/vsh.in
index 897f74cc08..5692788d63 100644
--- a/tools/bash-completion/vsh.in
+++ b/tools/bash-completion/vsh.in
@@ -30,7 +30,7 @@ _@command@_complete()
         c=$((++c))
     done
 
-    CMDLINE=( )
+    CMDLINE=( "-q" )
     if [ -n "${RO}" ]; then
         CMDLINE+=("-r")
     fi
-- 
2.44.1
Re: [PATCH 3/6] bash-completion: Run virsh/virt-admin in quiet mode
Posted by Peter Krempa 3 months, 3 weeks ago
On Mon, May 27, 2024 at 11:18:51 +0200, Michal Privoznik wrote:
> In some cases (e.g. when virt-admin connects to the default URI)
> some info message is printed onto stdout (using vshPrintExtra()).
> This hurts user experience, just consider:
> 
>   virt-admin<TAB><TAB>
>   NOTE\:\ Connecting\ to\ default\ daemon.\ Specify\ daemon\ using\ -c\ \(e.g.\ virtqemud\:///system\)
> 
> when no daemon is running. Suppress extra prints by passing '-q'
> in the bash-completion script.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  tools/bash-completion/vsh.in | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Peter Krempa <pkrempa@redhat.com>