Repository: mesonbuild/meson

Issue:
dependency.get_variable() keywords badly documented or broken
Meson 0.51 added a new method `get_variable()` to dependency objects. Unfortunately, both in 0.51.1 and in Git `master`, either the documentation or code or both are partially broken in respect of two of these keywords:

- `pkg-config`/`pkgconfig`: The example in the [0.51 release notes](https://mesonbuild.com/Release-notes-for-0-51-0.html#dependency-objects-now-have-a-get_variable-method) uses the keyword `pkg-config`. This should not (and does not) work, since identifiers cannot have a minus sign within them. The [reference manual](https://mesonbuild.com/Reference-manual.html#dependency-object), which needs proper code formatting, suggests `pkgconfig`, which does work, but...
- `default_value`: Use of this keyword causes big, bold invalid-keyword warnings when running Meson's own testcases, even though the testcases pass:
  
```
/Meson/test cases/common/219 dependency get_variable method> meson . build/
The Meson build system
Version: 0.51.999
Source dir: /Meson/test cases/common/219 dependency get_variable method
Build dir: /Meson/test cases/common/219 dependency get_variable method/build
Build type: native build
DEPRECATION: Duplicated values in array option is deprecated. This will become a hard error in the future.
Project name: dependency get_variable
Project version: undefined
C compiler for the build machine: cc (gcc 7.4.0 "cc (SUSE Linux) 7.4.0")
C++ compiler for the build machine: c++ (gcc 7.4.0 "c++ (SUSE Linux) 7.4.0")
C compiler for the host machine: cc (gcc 7.4.0 "cc (SUSE Linux) 7.4.0")
C++ compiler for the host machine: c++ (gcc 7.4.0 "c++ (SUSE Linux) 7.4.0")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Run-time dependency zlib found: YES 1.2.11
Dependency zlib found: YES (cached)
meson.build:18: WARNING: Passed invalid keyword argument "default_value".
WARNING: This will become a hard error in the future.
meson.build:20: WARNING: Passed invalid keyword argument "default_value".
WARNING: This will become a hard error in the future.
llvm-config found: NO
Run-time dependency LLVM found: NO (tried config-tool)
meson.build:26: WARNING: Skipping config-tool tests as llvm is not available or llvm-config was not found.
Found CMake: /usr/bin/cmake (3.10.2)
Run-time dependency LLVM found: NO (tried cmake)
meson.build:38: WARNING: Skipping cmake tests as llvm is not available via the cmake finder.
meson.build:51: WARNING: Passed invalid keyword argument "default_value".
WARNING: This will become a hard error in the future.
Build targets in project: 0
Found ninja-1.8.2 at /usr/bin/ninja
```

My guess is that
1) The Release Notes should be amended,
2) The Reference Manual should be properly formatted, and
3) The code fixed not to give warnings on the `default_value` keyword.


Discussion:

Resolving patch:
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -444,7 +444,7 @@ def partial_dependency_method(self, args, kwargs):
 
     @FeatureNew('dep.get_variable', '0.51.0')
     @noPosargs
-    @permittedKwargs({'cmake', 'pkgconfig', 'configtool', 'default', 'pkgconfig_define'})
+    @permittedKwargs({'cmake', 'pkgconfig', 'configtool', 'default_value', 'pkgconfig_define'})
     def variable_method(self, args, kwargs):
         return self.held_object.get_variable(**kwargs)
 


Test patch: