summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-07-22 07:20:33 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-07-27 14:04:15 +0000
commitd5e7987408202e2f6530f888935c4a6bd6115fde (patch)
treed6c51a9759b38927cea5b68a5696e27dc572ef8c
parentbdf0a3df38ccb86850527e381926d074a886d275 (diff)
downloadzsh-d5e7987408202e2f6530f888935c4a6bd6115fde.tar.gz
zsh-d5e7987408202e2f6530f888935c4a6bd6115fde.zip
38914 (tweaked): _pkg-config: Add options, complete *.pc files for positional arguments.
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_pkg-config13
2 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 61886b2b6..55d7c8044 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-07-27 Daniel Shahaf <d.s@daniel.shahaf.name>
+
+ * 38914 (tweaked): Completion/Unix/Command/_pkg-config: Add
+ options, complete *.pc files for positional arguments.
+
2016-07-26 Peter Stephenson <p.stephenson@samsung.com>
* 38945: Doc/Zsh/expn.yo: additional notes on :a behaviour.
diff --git a/Completion/Unix/Command/_pkg-config b/Completion/Unix/Command/_pkg-config
index 54955ebb1..dd73c79e9 100644
--- a/Completion/Unix/Command/_pkg-config
+++ b/Completion/Unix/Command/_pkg-config
@@ -3,12 +3,15 @@
local arguments packages curcontext="$curcontext" state line ret=1
declare -A opt_args
+# Up-to-date as of pkg-config 0.29-4 (debian package) man page synopsis
arguments=(
"--modversion[print the version information of a given package]"
+ "--version[print version information of pkg-config itself]"
"--atleast-pkgconfig-version=[require given version of pkg-config]:minimum version"
"(- *)"{--help,-\?}"[display a help message]"
"(- *)--usage[display brief usage message]"
"--print-errors[cause errors to be printed]"
+ "--short-errors[print short error messages]"
"--silence-errors[prevent the printing of errors]"
"--errors-to-stdout[print errors to stdout rather than stderr]"
"--cflags[print the preprocessor and compiler flags]"
@@ -19,14 +22,19 @@ arguments=(
"--libs-only-L[print the -L and -R parts of \"--libs\"]"
"--libs-only-l[print the -l part of \"--libs\"]"
"--libs-only-other[output other libs]"
+ "--validate[syntax check a .pc file]"
"--list-all[list all known packages]"
"--variable=[return the value of the specified variable]:variable:->variable"
"--define-variable=[set the global value for a variable]:name value pair"
+ "--print-variables[list all variables defined in the package]"
"--uninstalled[return success if any \"-uninstalled\" packages are being used]"
"--exists[test whether the package exists or not]"
"--atleast-version=[test whether the version is at least that of the specified value]:least value"
"--exact-version=[test whether the version is exactly that of the specified value]:exact value"
"--max-version=[test whether the version is no greater than some specific value]:max version"
+ "--print-provides[list all modules the package provides]"
+ "--print-requires[list all modules the package requires]"
+ "--print-requires-private[list all modules the package requires for static linking (see --static)]"
# "--msvc-syntax[output linker flags in a form compatible with MSVC++ (Windows only)]"
# "--dont-define-prefix[disables automatic overiding of the variable \"prefix\" (Windows only)]"
# "--prefix-variable=[set the name of the variable \"prefix\" (Windows only)]:prefix value"
@@ -38,7 +46,10 @@ _arguments -C -S : $arguments && ret=0
case $state in
(packages)
packages=( ${${(f)"$(_call_program packages pkg-config --list-all)"}%% *} )
- _wanted packages expl 'package' compadd -a - packages && ret=0
+ _alternative \
+ 'packages:package:compadd -a - packages' \
+ 'files:package file:_files -g "*.pc(-.)"' \
+ && ret=0
;;
(variable)