Use compgen -W in mock root completions.

This commit is contained in:
Ville Skyttä 2009-06-09 00:19:58 +03:00
parent 696ee59f7e
commit 8270b9cf81

View File

@ -32,8 +32,9 @@ _mock()
return 0
;;
-r|--root)
COMPREPLY=( $( command ls $cfgdir | \
sed -ne 's/^\('$cur'.*\)\.cfg$/\1/p') )
COMPREPLY=( $( compgen -W "$( command ls $cfgdir )" \
-- $cur ) )
COMPREPLY=( ${COMPREPLY[@]/%.cfg/} )
return 0
;;
--@(config|result)dir)