fish-shell/share/completions/configure.fish
Mahmoud Al-Qudsi 6c5e5d35a9 Add real completions for ./configure
This relies on the new `read --line/-L` support as an entire parser for
the output of `./configure --help`  was written in fishscript. Also
doesn't work without 72f32e6d8a7905b064680ec4b578c41dea62bf84.

The completion script is slow... a function of both the autotools
configure script itself being written in a shell script combined with a
fishscript output parser.

fish's own `./configure --help` takes around 350ms to execute, while
`__fish_parse_configure ./configure` (which runs that behind the scenes)
takes around 660ms to run, all-in-all - a not insignificant overhead.

Output can be cached (based off of ./configure hash or mtime) in the
future if this is a big deal.
2018-04-17 21:35:51 -05:00

16 lines
1.2 KiB
Fish

complete -c configure -s h -l help -x -a "short recursive" -d "Display help and exit"
complete -c configure -s V -l version -d "Display version and exit"
complete -c configure -s q -l quiet -d "Quiet mode"
complete -c configure -l cache-file -f -d "Cache test results in specified file"
complete -c configure -s C -l config-cache -d "Cache test results in file config.cache"
complete -c configure -s n -l no-create -d "Do not create output files"
complete -c configure -l srcdir -d "Set source directory" -a "__fish_complete_directories (commandline -ct)" -x
complete -c configure -l prefix -d "Architecture-independent install directory" -a "__fish_complete_directories (commandline -ct)" -x
complete -c configure -l exec-prefix -d "Architecture-dependent install directory" -a "__fish_complete_directories (commandline -ct)" -x
complete -c configure -l build -d "Configure for building on BUILD" -x
complete -c configure -l host -d "Cross-compile to build programs to run on HOST" -x
complete -c configure -l target -d "Configure for building compilers for TARGET" -x
# use autoconf's --help to generate completions:
echo "sourcing configure completions"
complete -c 'configure' -a '(__fish_parse_configure (commandline | string replace -r "(.*configure) .*" "\$1"))'