mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
bash: execute --long-options only when needed
Delay the execution of $tool --long-options only when really using its output.
This commit is contained in:
@@ -35,8 +35,6 @@ _guestmount ()
|
||||
|
||||
_init_completion -s || return
|
||||
|
||||
longopts="$(guestmount --long-options)"
|
||||
|
||||
# See if user has specified certain options anywhere on the
|
||||
# command line before the current word.
|
||||
while [ $c -lt $COMP_CWORD ]; do
|
||||
@@ -57,6 +55,7 @@ _guestmount ()
|
||||
case "$cur" in
|
||||
--*)
|
||||
# --options
|
||||
longopts="$(guestmount --long-options)"
|
||||
COMPREPLY=( $(compgen -W "$longopts" -- "$cur") )
|
||||
return ;;
|
||||
*)
|
||||
|
||||
Reference in New Issue
Block a user