Add/improve various autotools completions.
This commit is contained in:
parent
4162edf2c1
commit
8f0055553b
1
CHANGES
1
CHANGES
@ -36,6 +36,7 @@ bash-completion (2.x)
|
|||||||
* Improve relevance of many user/group completions, depending on context.
|
* Improve relevance of many user/group completions, depending on context.
|
||||||
* Remove most "-o filenames" options to "complete", turn "-o filenames" on
|
* Remove most "-o filenames" options to "complete", turn "-o filenames" on
|
||||||
dynamically when needed instead.
|
dynamically when needed instead.
|
||||||
|
* Add/improve various autotools completions.
|
||||||
|
|
||||||
[ Freddy Vulto ]
|
[ Freddy Vulto ]
|
||||||
* Added _tilde(), fix ~username completion (Alioth: #312613, Debian: #587095)
|
* Added _tilde(), fix ~username completion (Alioth: #312613, Debian: #587095)
|
||||||
|
@ -1575,7 +1575,7 @@ _longopt()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
# makeinfo and texi2dvi are defined elsewhere.
|
# makeinfo and texi2dvi are defined elsewhere.
|
||||||
for i in a2ps autoconf automake awk bash bc bison cat colordiff cp csplit \
|
for i in a2ps awk bash bc bison cat colordiff cp csplit \
|
||||||
curl cut date df diff dir du enscript env expand fmt fold gperf gprof \
|
curl cut date df diff dir du enscript env expand fmt fold gperf gprof \
|
||||||
grep grub head indent irb ld ldd less ln ls m4 md5sum mkdir mkfifo mknod \
|
grep grub head indent irb ld ldd less ln ls m4 md5sum mkdir mkfifo mknod \
|
||||||
mv netstat nl nm objcopy objdump od paste patch pr ptx readelf rm rmdir \
|
mv netstat nl nm objcopy objdump od paste patch pr ptx readelf rm rmdir \
|
||||||
|
@ -6,6 +6,8 @@ bashcomp_DATA = abook \
|
|||||||
apt-build \
|
apt-build \
|
||||||
aptitude \
|
aptitude \
|
||||||
aspell \
|
aspell \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
autorpm \
|
autorpm \
|
||||||
bash-builtins \
|
bash-builtins \
|
||||||
bind-utils \
|
bind-utils \
|
||||||
|
124
completions/autoconf
Normal file
124
completions/autoconf
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
# Completions for autoconf tools
|
||||||
|
|
||||||
|
have autoconf &&
|
||||||
|
_autoconf()
|
||||||
|
{
|
||||||
|
COMPREPLY=()
|
||||||
|
local cur prev split=false
|
||||||
|
_get_comp_words_by_ref cur prev
|
||||||
|
|
||||||
|
_split_longopt && split=true
|
||||||
|
|
||||||
|
case "$prev" in
|
||||||
|
--help|-h|--version|-V|--trace|-t)
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
--output|-o)
|
||||||
|
_filedir
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
--warnings|-W)
|
||||||
|
local cats=( cross obsolete syntax )
|
||||||
|
COMPREPLY=( $( compgen -W \
|
||||||
|
'${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
--prepend-include|-B|--include|-I)
|
||||||
|
_filedir -d
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
$split && return 0
|
||||||
|
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
_longopt $1
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
_filedir '@(ac|in)'
|
||||||
|
} &&
|
||||||
|
complete -F _autoconf autoconf
|
||||||
|
|
||||||
|
have autoreconf || have autoheader &&
|
||||||
|
_autoreconf()
|
||||||
|
{
|
||||||
|
COMPREPLY=()
|
||||||
|
local cur prev split=false
|
||||||
|
_get_comp_words_by_ref cur prev
|
||||||
|
|
||||||
|
_split_longopt && split=true
|
||||||
|
|
||||||
|
case "$prev" in
|
||||||
|
--help|-h|--version|-V)
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
--warnings|-W)
|
||||||
|
local cats=( cross gnu obsolete override portability syntax \
|
||||||
|
unsupported )
|
||||||
|
COMPREPLY=( $( compgen -W \
|
||||||
|
'${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
--prepend-include|-B|--include|-I)
|
||||||
|
_filedir -d
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
$split && return 0
|
||||||
|
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
_longopt $1
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $1 == autoheader ]] ; then
|
||||||
|
_filedir '@(ac|in)'
|
||||||
|
else
|
||||||
|
_filedir -d
|
||||||
|
fi
|
||||||
|
} &&
|
||||||
|
complete -F _autoreconf autoreconf autoheader
|
||||||
|
|
||||||
|
have autoscan || have autoupdate &&
|
||||||
|
_autoscan()
|
||||||
|
{
|
||||||
|
COMPREPLY=()
|
||||||
|
local cur prev split=false
|
||||||
|
_get_comp_words_by_ref cur prev
|
||||||
|
|
||||||
|
_split_longopt && split=true
|
||||||
|
|
||||||
|
case "$prev" in
|
||||||
|
--help|-h|--version|-V)
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
--prepend-include|-B|--include|-I)
|
||||||
|
_filedir -d
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
$split && return 0
|
||||||
|
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
_longopt $1
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $1 == autoupdate ]] ; then
|
||||||
|
_filedir '@(ac|in)'
|
||||||
|
else
|
||||||
|
_filedir -d
|
||||||
|
fi
|
||||||
|
} &&
|
||||||
|
complete -F _autoscan autoscan autoupdate
|
||||||
|
|
||||||
|
# Local variables:
|
||||||
|
# mode: shell-script
|
||||||
|
# sh-basic-offset: 4
|
||||||
|
# sh-indent-comment: t
|
||||||
|
# indent-tabs-mode: nil
|
||||||
|
# End:
|
||||||
|
# ex: ts=4 sw=4 et filetype=sh
|
80
completions/automake
Normal file
80
completions/automake
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
# Completions for automake tools
|
||||||
|
|
||||||
|
have automake &&
|
||||||
|
_automake()
|
||||||
|
{
|
||||||
|
COMPREPLY=()
|
||||||
|
local cur prev split=false
|
||||||
|
_get_comp_words_by_ref cur prev
|
||||||
|
|
||||||
|
_split_longopt && split=true
|
||||||
|
|
||||||
|
case "$prev" in
|
||||||
|
--help|--version)
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
--warnings|-W)
|
||||||
|
local cats=( gnu obsolete override portability syntax unsupported )
|
||||||
|
COMPREPLY=( $( compgen -W \
|
||||||
|
'${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
--libdir)
|
||||||
|
_filedir -d
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
$split && return 0
|
||||||
|
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
_longopt $1
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
_filedir
|
||||||
|
} &&
|
||||||
|
complete -F _automake automake automake-1.11
|
||||||
|
|
||||||
|
have aclocal &&
|
||||||
|
_aclocal()
|
||||||
|
{
|
||||||
|
COMPREPLY=()
|
||||||
|
local cur prev split=false
|
||||||
|
_get_comp_words_by_ref cur prev
|
||||||
|
|
||||||
|
_split_longopt && split=true
|
||||||
|
|
||||||
|
case "$prev" in
|
||||||
|
--help|--print-ac-dir|--version)
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
--acdir|-I)
|
||||||
|
_filedir -d
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
--output)
|
||||||
|
_filedir
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
--warnings|-W)
|
||||||
|
local cats=( syntax unsupported )
|
||||||
|
COMPREPLY=( $( compgen -W \
|
||||||
|
'${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
$split && return 0
|
||||||
|
|
||||||
|
_longopt $1
|
||||||
|
} &&
|
||||||
|
complete -F _aclocal aclocal aclocal-1.11
|
||||||
|
|
||||||
|
# Local variables:
|
||||||
|
# mode: shell-script
|
||||||
|
# sh-basic-offset: 4
|
||||||
|
# sh-indent-comment: t
|
||||||
|
# indent-tabs-mode: nil
|
||||||
|
# End:
|
||||||
|
# ex: ts=4 sw=4 et filetype=sh
|
1
test/completion/aclocal.exp
Normal file
1
test/completion/aclocal.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions aclocal
|
1
test/completion/autoheader.exp
Normal file
1
test/completion/autoheader.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions autoheader
|
1
test/completion/autoreconf.exp
Normal file
1
test/completion/autoreconf.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions autoreconf
|
1
test/completion/autoscan.exp
Normal file
1
test/completion/autoscan.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions autoscan
|
1
test/completion/autoupdate.exp
Normal file
1
test/completion/autoupdate.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions autoupdate
|
20
test/lib/completions/aclocal.exp
Normal file
20
test/lib/completions/aclocal.exp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "aclocal "
|
||||||
|
|
||||||
|
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
20
test/lib/completions/autoheader.exp
Normal file
20
test/lib/completions/autoheader.exp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "autoheader "
|
||||||
|
|
||||||
|
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
20
test/lib/completions/autoreconf.exp
Normal file
20
test/lib/completions/autoreconf.exp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "autoreconf "
|
||||||
|
|
||||||
|
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
20
test/lib/completions/autoscan.exp
Normal file
20
test/lib/completions/autoscan.exp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "autoscan "
|
||||||
|
|
||||||
|
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
20
test/lib/completions/autoupdate.exp
Normal file
20
test/lib/completions/autoupdate.exp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "autoupdate "
|
||||||
|
|
||||||
|
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
Loading…
x
Reference in New Issue
Block a user