Update colored output documentation

This commit is contained in:
Dennis Camera 2020-06-05 13:56:30 +02:00
parent 89e48734bf
commit 790c6efae9
2 changed files with 51 additions and 22 deletions

View file

@ -34,7 +34,7 @@ dest="$__cdist_abs_mydir/$filename"
cd "$__cdist_abs_mydir" cd "$__cdist_abs_mydir"
exec > "$dest" exec > "$dest"
cat << eof cat << eof
Reference Reference
========= =========
Variable, path and type reference for cdist Variable, path and type reference for cdist
@ -51,7 +51,7 @@ eof
done done
) )
cat << eof cat << eof
Paths Paths
----- -----
@ -187,13 +187,13 @@ usable within a object directory:
files files
This directory is reserved for user data and will not be used This directory is reserved for user data and will not be used
by cdist at any time. It can be used freely by the type by cdist at any time. It can be used freely by the type
(for instance to store template results). (for instance to store template results).
changed changed
This empty file exists in an object directory, if the object has This empty file exists in an object directory, if the object has
code to be executed (either remote or local). code to be executed (either remote or local).
stdin stdin
This file exists and contains data, if data was provided on stdin This file exists and contains data, if data was provided on stdin
when the type was called. when the type was called.
@ -222,65 +222,89 @@ __cdist_log_level, __cdist_log_level_name
| TRACE | 5 | | TRACE | 5 |
+----------------+-----------------+ +----------------+-----------------+
Available for: initial manifest, explorer, type manifest, type explorer,
type gencode.
__cdist_colored_log
whether or not cdist's log has colors enabled.
Is set to the string ``true`` if cdist's output is using colors,
otherwise the variable contains the string ``false``.
Available for: initial manifest, explorer, type manifest, type explorer, Available for: initial manifest, explorer, type manifest, type explorer,
type gencode. type gencode.
__cdist_dry_run __cdist_dry_run
Is set only when doing dry run (``-n`` flag). Is set only when doing dry run (``-n`` flag).
Available for: initial manifest, explorer, type manifest, type explorer, Available for: initial manifest, explorer, type manifest, type explorer,
type gencode. type gencode.
__explorer __explorer
Directory that contains all global explorers. Directory that contains all global explorers.
Available for: initial manifest, explorer, type explorer, shell. Available for: initial manifest, explorer, type explorer, shell.
__files __files
Directory that contains content from the "files" subdirectories Directory that contains content from the "files" subdirectories
from the configuration directories. from the configuration directories.
Available for: initial manifest, type manifest, type gencode, shell. Available for: initial manifest, type manifest, type gencode, shell.
__manifest __manifest
Directory that contains the initial manifest. Directory that contains the initial manifest.
Available for: initial manifest, type manifest, shell. Available for: initial manifest, type manifest, shell.
__global __global
Directory that contains generic output like explorer. Directory that contains generic output like explorer.
Available for: initial manifest, type manifest, type gencode, shell. Available for: initial manifest, type manifest, type gencode, shell.
__messages_in __messages_in
File to read messages from. File to read messages from.
Available for: initial manifest, type manifest, type gencode. Available for: initial manifest, type manifest, type gencode.
__messages_out __messages_out
File to write messages. File to write messages.
Available for: initial manifest, type manifest, type gencode. Available for: initial manifest, type manifest, type gencode.
__object __object
Directory that contains the current object. Directory that contains the current object.
Available for: type manifest, type explorer, type gencode and code scripts. Available for: type manifest, type explorer, type gencode and code scripts.
__object_id __object_id
The type unique object id. The type unique object id.
Available for: type manifest, type explorer, type gencode and code scripts. Available for: type manifest, type explorer, type gencode and code scripts.
Note: The leading and the trailing "/" will always be stripped (caused by
the filesystem database and ensured by the core). | Note: The leading and the trailing "/" will always be stripped (caused by
Note: Double slashes ("//") will not be fixed and result in an error. the filesystem database and ensured by the core).
| Note: Double slashes ("//") will not be fixed and result in an error.
__object_name __object_name
The full qualified name of the current object. The full qualified name of the current object.
Available for: type manifest, type explorer, type gencode. Available for: type manifest, type explorer, type gencode.
__target_host __target_host
The host we are deploying to. This is primary variable. It's content is The host we are deploying to. This is primary variable. It's content is
literally the one user passed in. literally the one user passed in.
Available for: explorer, initial manifest, type explorer, type manifest, type gencode, shell. Available for: explorer, initial manifest, type explorer, type manifest, type gencode, shell.
__target_hostname __target_hostname
The hostname of host we are deploying to. This variable is derived from The hostname of host we are deploying to. This variable is derived from
**__target_host** (using **socket.getaddrinfo(__target_host)** and then **__target_host** (using **socket.getaddrinfo(__target_host)** and then
**socket.gethostbyaddr()**). **socket.gethostbyaddr()**).
Available for: explorer, initial manifest, type explorer, type manifest, type gencode, shell. Available for: explorer, initial manifest, type explorer, type manifest, type gencode, shell.
__target_fqdn __target_fqdn
The fully qualified domain name of the host we are deploying to. The fully qualified domain name of the host we are deploying to.
This variable is derived from **__target_host** This variable is derived from **__target_host**
(using **socket.getfqdn()**). (using **socket.getfqdn()**).
Available for: explorer, initial manifest, type explorer, type manifest, type gencode, shell. Available for: explorer, initial manifest, type explorer, type manifest, type gencode, shell.
__target_host_tags __target_host_tags
Comma separated list of target host tags. Comma separated list of target host tags.
Available for: explorer, initial manifest, type explorer, type manifest, type gencode, shell. Available for: explorer, initial manifest, type explorer, type manifest, type gencode, shell.
__type __type
Path to the current type. Path to the current type.
Available for: type manifest, type gencode. Available for: type manifest, type gencode.
__type_explorer __type_explorer
Directory that contains the type explorers. Directory that contains the type explorers.
Available for: type explorer. Available for: type explorer.
Environment variables (for writing) Environment variables (for writing)

View file

@ -112,9 +112,13 @@ All commands accept the following options:
Show the help screen. Show the help screen.
**--colors COLORED_OUTPUT** **--colors COLORED_OUTPUT**
Use a colored output for different log levels.It can Colorize cdist's output. If enabled, cdist will use different colors for
be a boolean or "auto" (default) which enables this different log levels.
feature if stdout is a tty and disables it otherwise. COLORED_OUTPUT recognizes the boolean values 'yes'/'no', 'on'/'off',
'true'/'false', '1'/'0', and 'auto' (the default).
If the value is 'auto', colored output is enabled if stdout is a TTY
unless the NO_COLOR (https://no-color.org/) environment variable is defined.
**-l LOGLEVEL, --log-level LOGLEVEL** **-l LOGLEVEL, --log-level LOGLEVEL**
Set the specified verbosity level. The levels, in Set the specified verbosity level. The levels, in
@ -168,7 +172,7 @@ Install command is currently in beta.
**-b, --beta** **-b, --beta**
Enable beta functionality. Enable beta functionality.
**-C CACHE_PATH_PATTERN, --cache-path-pattern CACHE_PATH_PATTERN** **-C CACHE_PATH_PATTERN, --cache-path-pattern CACHE_PATH_PATTERN**
Specify custom cache path pattern. If it is not set then Specify custom cache path pattern. If it is not set then
default hostdir is used. For more info on format see default hostdir is used. For more info on format see
@ -191,7 +195,7 @@ Install command is currently in beta.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR** **-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory Use specified custom inventory directory. Inventory
directory is set up by the following rules: if cdist directory is set up by the following rules: if cdist
configuration resolves this value then specified configuration resolves this value then specified
directory is used, if HOME env var is set then directory is used, if HOME env var is set then
~/.cdit/inventory is used, otherwise distribution ~/.cdit/inventory is used, otherwise distribution
@ -306,7 +310,7 @@ Add host(s) to inventory database.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR** **-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory Use specified custom inventory directory. Inventory
directory is set up by the following rules: if cdist directory is set up by the following rules: if cdist
configuration resolves this value then specified configuration resolves this value then specified
directory is used, if HOME env var is set then directory is used, if HOME env var is set then
~/.cdit/inventory is used, otherwise distribution ~/.cdit/inventory is used, otherwise distribution
@ -336,7 +340,7 @@ Add tag(s) to inventory database.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR** **-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory Use specified custom inventory directory. Inventory
directory is set up by the following rules: if cdist directory is set up by the following rules: if cdist
configuration resolves this value then specified configuration resolves this value then specified
directory is used, if HOME env var is set then directory is used, if HOME env var is set then
~/.cdit/inventory is used, otherwise distribution ~/.cdit/inventory is used, otherwise distribution
@ -379,7 +383,7 @@ Delete host(s) from inventory database.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR** **-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory Use specified custom inventory directory. Inventory
directory is set up by the following rules: if cdist directory is set up by the following rules: if cdist
configuration resolves this value then specified configuration resolves this value then specified
directory is used, if HOME env var is set then directory is used, if HOME env var is set then
~/.cdit/inventory is used, otherwise distribution ~/.cdit/inventory is used, otherwise distribution
@ -413,7 +417,7 @@ Delete tag(s) from inventory database.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR** **-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory Use specified custom inventory directory. Inventory
directory is set up by the following rules: if cdist directory is set up by the following rules: if cdist
configuration resolves this value then specified configuration resolves this value then specified
directory is used, if HOME env var is set then directory is used, if HOME env var is set then
~/.cdit/inventory is used, otherwise distribution ~/.cdit/inventory is used, otherwise distribution
@ -460,7 +464,7 @@ List inventory database.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR** **-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory Use specified custom inventory directory. Inventory
directory is set up by the following rules: if cdist directory is set up by the following rules: if cdist
configuration resolves this value then specified configuration resolves this value then specified
directory is used, if HOME env var is set then directory is used, if HOME env var is set then
~/.cdit/inventory is used, otherwise distribution ~/.cdit/inventory is used, otherwise distribution
@ -685,6 +689,9 @@ The possible keywords and their meanings are as follows:
:strong:`cache_path_pattern` :strong:`cache_path_pattern`
Specify cache path pattern. Specify cache path pattern.
:strong:`colored_output`
Colorize cdist's output. cf. the :code:`--colors` option.
:strong:`conf_dir` :strong:`conf_dir`
List of configuration directories separated with the character conventionally List of configuration directories separated with the character conventionally
used by the operating system to separate search path components (as in PATH), used by the operating system to separate search path components (as in PATH),
@ -738,7 +745,7 @@ The possible keywords and their meanings are as follows:
in the format: YYYYMMDDHHMMSS.us. in the format: YYYYMMDDHHMMSS.us.
:strong:`verbosity` :strong:`verbosity`
Set verbosity level. Valid values are: Set verbosity level. Valid values are:
'ERROR', 'WARNING', 'INFO', 'VERBOSE', 'DEBUG', 'TRACE' and 'OFF'. 'ERROR', 'WARNING', 'INFO', 'VERBOSE', 'DEBUG', 'TRACE' and 'OFF'.
@ -770,7 +777,7 @@ cdist/preos
NOTES NOTES
----- -----
cdist detects if host is specified by IPv6 address. If so then remote_copy cdist detects if host is specified by IPv6 address. If so then remote_copy
command is executed with host address enclosed in square brackets command is executed with host address enclosed in square brackets
(see :strong:`scp`\ (1)). (see :strong:`scp`\ (1)).
EXAMPLES EXAMPLES
@ -906,9 +913,7 @@ CDIST_CACHE_PATH_PATTERN
Custom cache path pattern. Custom cache path pattern.
CDIST_COLORED_OUTPUT CDIST_COLORED_OUTPUT
Use a colored output for different log levels. Colorize cdist's output. cf. the :code:`--colors` option.
It can be a boolean or 'auto' (default) which enables this feature if
stdout is a tty and disables it otherwise.
CDIST_CONFIG_FILE CDIST_CONFIG_FILE
Custom configuration file. Custom configuration file.