output envdir as JSON or YAML
Project description
cfgdir
Read envdir style configuration directory and output as JSON or YAML
Project is hosted at https://github.com/rstms/cfgdir
Inspired by djb's excellent envdir, a component of daemontools
Leverage the powerful simplicity of the filesystem as your configuration database, and the freedom to fluidly manipulate configuration data from your shell.
Unlike envdir's mechanism of running another program with the configuration in environment variables, this program outputs a stream in JSON or YAML format. This output can be captured in a file or piped into stdin of another program.
Interface
cfgdir [OPTIONS] d [INPUT] [OUTPUT]
optionally reads a JSON or YAML object from INPUT (use - to read stdin) , then reads the directory named d, outputting a JSON or YAML object modified according to files in d.
The format of d is as follows: (adapted from envdir's documentation)
If d contains a file named s whose first line is t, cfgdir's output will contain an element named s with string value t. The name s must not contain =. Spaces and tabs at the end of t are removed. Nulls in t are changed to newlines.
If the file s is completely empty (0 bytes long) cfgdir will remove the element named s if it exists.
Arguments:
Argument | default | Description | |
---|---|---|---|
DIRECTORY | required | Directory containing configuration data files | |
INPUT | optional | /dev/null | Input filename or - for stdin |
OUPUT | optional | stdout | Output Filename or - for stdout |
Options:
-c, --compact minimize output
-s, --sort sort output
-j, --json JSON format
-y, --yaml YAML format
-r, --recurse process subdirectories
--help Show this message and exit.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cfgdir-0.2.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5211b30d29c07cc654fd91f5f6c57a8c5a1f4af06def6778b900853fc7023ae |
|
MD5 | 0abd07087d3e0e7fc6089c6a3329b237 |
|
BLAKE2b-256 | 4e0cc1417eac5a770abfa931303715d58dcbb34b210e616c71a677465dd8067d |