1
# mdtool completion -*- shell-script -*-
5
local cur prev words cword
6
_init_completion || return
10
for (( i=0; i < ${#words[@]}-1; i++ )); do
11
if [[ ${words[i]} == @(build|generate-makefiles|setup) ]]; then
16
if [[ -n "$command" ]]; then
19
COMPREPLY=( $( compgen -W '--f --buildfile --p --project' \
21
# TODO: This does not work :(
22
#if [[ "$prev" == *: ]]; then
25
# COMPREPLY=( $( compgen -f -G "*.mdp" -- "$cur" ) )
27
# @(--f:|--buildfile:))
28
# COMPREPLY=( $( compgen -f -G "*.mdp" -G "*.mds" -- "$cur" ) )
36
COMPREPLY=( $( compgen -o filenames -G"*.mds" -- "$cur" ) )
37
if [[ "$prev" == *mds ]]; then
38
COMPREPLY=( $( compgen -W '--simple-makefiles --s --d:' \
44
# TODO: at least return filenames after these options.
45
COMPREPLY=( $( compgen -W 'install i uninstall u check-install \
46
ci update up list l list-av la list-update lu rep-add ra \
47
rep-remove rr rep-update ru rep-list rl reg-update \
48
reg-build rgu info rep-build rb pack p help h dump-file' \
55
COMPREPLY=( $( compgen -W 'gsetup build dbgen project-export \
56
generate-makefiles gettext-update setup -q' -- "$cur" ) )
60
complete -F _mdtool mdtool
62
# ex: ts=4 sw=4 et filetype=sh