bash-completion: machinectl: suggest arguments for --verify and --format

This also changes to use '--output=help' for suggesting arguments of
--output option.
This commit is contained in:
Yu Watanabe 2018-12-14 02:02:27 +09:00
parent 0e5bea97e9
commit fad73e9deb
1 changed files with 7 additions and 1 deletions

View File

@ -77,7 +77,13 @@ _machinectl() {
comps=''
;;
--output|-o)
comps='short short-full short-iso short-iso-precise short-precise short-monotonic short-unix verbose export json json-pretty json-sse json-seq cat with-unit'
comps=$( machinectl --output=help 2>/dev/null )
;;
--verify)
comps=$( machinectl --verify=help 2>/dev/null )
;;
--format)
comps='uncompressed xz gzip bzip2'
;;
esac
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )