about summary refs log tree commit diff
path: root/Functions/Completion/_configure
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/Completion/_configure')
-rw-r--r--Functions/Completion/_configure12
1 files changed, 12 insertions, 0 deletions
diff --git a/Functions/Completion/_configure b/Functions/Completion/_configure
new file mode 100644
index 000000000..de8d5fba5
--- /dev/null
+++ b/Functions/Completion/_configure
@@ -0,0 +1,12 @@
+#defcomp configure
+
+if [[ $PREFIX = *=* ]]; then
+  # Complete filenames after e.g. --prefix=
+  IPREFIX=${PREFIX%%=*}=
+  PREFIX=${PREFIX#*=}
+  complist -f
+else
+  # Generate a list of options from configure --help
+  complist -s '$($COMMAND --help |
+  sed -n -e '\''s/^ *\(--[-a-z0-9]*\)[    =,].*$/\1/p'\'')'
+fi