mirror of
https://github.com/thegeeklab/ansible-later.git
synced 2024-11-29 08:10:36 +00:00
146 lines
4.5 KiB
Groff
146 lines
4.5 KiB
Groff
.\" It was based on the output generated by help2man 1.47.6.
|
|
.TH ANYCONFIG_CLI "1" "June 2018" "anyconfig_cli 0.9.5" "User Commands"
|
|
.SH NAME
|
|
anyconfig_cli \- manual page for anyconfig_cli 0.9.5
|
|
.SH SYNOPSIS
|
|
.B anyconfig_cli
|
|
[\fIOptions\fR...] \fICONF_PATH_OR_PATTERN_0 \fR[\fICONF_PATH_OR_PATTERN_1 \fR..]
|
|
.SH OPTIONS
|
|
.TP
|
|
\fB\-\-version\fR
|
|
show program's version number and exit
|
|
.TP
|
|
\fB\-h\fR, \fB\-\-help\fR
|
|
show this help message and exit
|
|
.TP
|
|
\fB\-L\fR, \fB\-\-list\fR
|
|
List supported config types
|
|
.TP
|
|
\fB\-o\fR OUTPUT, \fB\-\-output\fR=\fIOUTPUT\fR
|
|
Output file path
|
|
.TP
|
|
\fB\-I\fR ITYPE, \fB\-\-itype\fR=\fIITYPE\fR
|
|
Select type of Input config files from ini, json, xml,
|
|
yaml [Automatically detected by file ext]
|
|
.TP
|
|
\fB\-O\fR OTYPE, \fB\-\-otype\fR=\fIOTYPE\fR
|
|
Select type of Output config files from ini, json,
|
|
xml, yaml and so on [Automatically detected by file ext]
|
|
.TP
|
|
\fB\-M\fR MERGE, \fB\-\-merge\fR=\fIMERGE\fR
|
|
Select strategy to merge multiple configs from
|
|
replace, noreplace, merge_dicts, merge_dicts_and_lists
|
|
[merge_dicts]
|
|
.TP
|
|
\fB\-A\fR ARGS, \fB\-\-args\fR=\fIARGS\fR
|
|
Argument configs to override
|
|
.TP
|
|
\fB\-\-atype\fR=\fIATYPE\fR
|
|
Explicitly select type of argument to provide configs
|
|
from ini, json, xml, yaml and so on. If this option is not set,
|
|
original parser is used: 'K:V' will become {K: V},
|
|
\&'K:V_0,V_1,..' will become {K: [V_0, V_1, ...]}, and
|
|
\&'K_0:V_0;K_1:V_1' will become {K_0: V_0, K_1: V_1}
|
|
(where the tyep of K is str, type of V is one of Int,
|
|
str, etc.
|
|
.TP
|
|
\fB\-\-query\fR=\fIQUERY\fR
|
|
Specify JMESPath expression to query part of config, for example,
|
|
if a config {'a': {'b': {'c': 0, 'd': [1, 2, 3]}}} '--query
|
|
a.b.d[0]' gives 1 and '--query a.b' gives {'c': 0, 'd': [1, 2, 3]}.
|
|
\fB\-\-get\fR=\fIGET\fR
|
|
Specify key path to get part of config, for example,
|
|
if a config {'a': {'b': {'c': 0, 'd': 1}}} '--get
|
|
a.b.c' gives 0 and '--get a.b' gives {'c': 0, 'd': 1}.
|
|
\fB\-\-set\fR=\fIGET\fR
|
|
Specify key path to set (update) part of config, for example, '--set a.b.c=1'
|
|
to a config {'a': {'b': {'c': 0, 'd': 1}}} gives {'a': {'b': {'c': 1, 'd':
|
|
1}}}.
|
|
.TP
|
|
\fB\-x\fR, \fB\-\-ignore\-missing\fR
|
|
Ignore missing input files
|
|
.TP
|
|
\fB\-T\fR, \fB-\-template\fR
|
|
Enable support to load jinja2 based template configuration files
|
|
.TP
|
|
\fB\-E\fR, \fB\-\-env\fR
|
|
Load configuration defaults from environment values
|
|
.TP
|
|
\fB\-S\fR SCHEMA, \fR\-\-schema=\fISCHEMA\fR
|
|
Specify Schema file[s] path
|
|
.TP
|
|
\fB\-\-validate\fR
|
|
Only validate input files and do not output. You must specify schema file with
|
|
\fR\-S\fR/\fR\-\-schema\fR option.
|
|
.TP
|
|
\fR\-\-gen\-schema\fR
|
|
Generate JSON schema for givne config file[s] and output it.
|
|
.TP
|
|
\fB\-s\fR, \fB\-\-silent\fR
|
|
Silent or quiet mode
|
|
.TP
|
|
\fB\-q\fR, \fB\-\-quiet\fR
|
|
Same as \fB\-\-silent\fR option
|
|
.TP
|
|
\fB\-v\fR, \fB\-\-verbose\fR
|
|
Verbose mode
|
|
.SH EXAMPLES
|
|
.PP
|
|
List supported configuration types.
|
|
.PP
|
|
anyconfig_cli \-\-list
|
|
.PP
|
|
Load a YAML config /etc/xyz/conf.d/a.conf and dump parsed result to stdout in
|
|
JSON format by specifying input and output formats explicitly.
|
|
.PP
|
|
anyconfig_cli \-I yaml \-O json /etc/xyz/conf.d/a.conf
|
|
.PP
|
|
Similar to the previous example but inputs may be multiple files as the input
|
|
is glob pattern.
|
|
.PP
|
|
anyconfig_cli \-I yaml '/etc/xyz/conf.d/*.conf' \-o xyz.conf \-\-otype json\fR
|
|
.PP
|
|
Similar to the previous example but configuration specified w/ \-A (\-\-args)
|
|
option added.
|
|
.PP
|
|
anyconfig_cli '/etc/xyz/conf.d/*.json' \-o xyz.yml \-\-atype json \-A '{"obsoletes": "sysdata", "conflicts": "sysdata\-old"}'
|
|
.PP
|
|
Same as the previous example.
|
|
.PP
|
|
anyconfig_cli '/etc/xyz/conf.d/*.json' \-o xyz.yml \-A obsoletes:sysdata;conflicts:sysdata\-old
|
|
.PP
|
|
Load multiple JSON files with merge strategy 'noreplace'.
|
|
.PP
|
|
anyconfig_cli -O json '/etc/foo.d/*.json' \-M noreplace
|
|
.PP
|
|
Get the part of input configuration files.
|
|
.PP
|
|
anyconfig_cli '/etc/foo.d/*.json' \-\-get a.b.c
|
|
.PP
|
|
Set the part of input configuration files.
|
|
.PP
|
|
anyconfig_cli '/etc/foo.d/*.json' \-\-set a.b.c=1
|
|
.PP
|
|
Validate input configuration files with JSON schema.
|
|
.PP
|
|
anyconfig_cli \-\-validate \-S foo.conf.schema.yml '/etc/foo.d/*.xml'
|
|
.PP
|
|
Generate JSON schema for input configuration files.
|
|
.PP
|
|
anyconfig_cli \-\-gen\-schema '/etc/foo.d/*.xml' \-o foo.conf.schema.yml
|
|
.PP
|
|
Load environment variables and output it as JSON data.
|
|
.PP
|
|
anyconfig_cli \-\-env \-O json
|
|
.SH "NOTES"
|
|
.IP " 1." 4
|
|
python-anyconfig (anyconfig_cli) home page
|
|
.RS 4
|
|
\%https://github.com/ssato/python-anyconfig
|
|
.RE
|
|
.IP " 2." 4
|
|
python-anyconfig (anyconfig_cli) Online Doc
|
|
.RS 4
|
|
\%http://python-anyconfig.readthedocs.org/en/latest/
|
|
.RE
|