2020-04-20 07:37:34 +00:00
|
|
|
#!/usr/bin/python3
|
|
|
|
import sys
|
|
|
|
|
|
|
|
import yaml
|
|
|
|
|
|
|
|
|
|
|
|
config = yaml.safe_load(open(sys.argv[1]))
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
|
|
|
|
for arg in sys.argv[2:]:
|
2020-06-15 01:19:58 +00:00
|
|
|
if '=' in arg:
|
|
|
|
k, expected = arg.split('=', 1)
|
|
|
|
expected = yaml.safe_load(expected)
|
|
|
|
else:
|
|
|
|
k, expected = arg, None
|
2020-04-20 07:37:34 +00:00
|
|
|
v = config
|
|
|
|
for part in k.split('.'):
|
|
|
|
v = v[part]
|
2020-06-15 01:19:58 +00:00
|
|
|
if expected is None:
|
|
|
|
print(v)
|
|
|
|
else:
|
|
|
|
assert v == expected, "{!r} != {!r}".format(v, expected)
|
|
|
|
|
2020-04-20 07:37:34 +00:00
|
|
|
|
|
|
|
main()
|