Skip to content

Commit

Permalink
Markdown documentation and default for --undefined.
Browse files Browse the repository at this point in the history
  • Loading branch information
m000 committed Jan 14, 2020
1 parent 18dfd3c commit 8a4d5b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ Options:
To import environment variables into the global scope, give it an empty string: `--import-env=`.
(This will overwrite any existing variables!)
* `-o outfile`: Write rendered template to a file
* `--undefined`: Allow undefined variables to be used in templates (no error will be raised)

* `--undefined={strict, normal, debug}`: Specify the behaviour of `j2cli` for undefined
variables. Refer to [Jinja2 docs][jinja2-undefined] for details.
* `--filters filters.py`: Load custom Jinja2 filters and tests from a Python file.
Will load all top-level functions and register them as filters.
This option can be used multiple times to import several files.
Expand Down Expand Up @@ -137,4 +137,5 @@ j2cli is inspired by Matt Robenolt's [jinja2-cli][jinja2-cli].
[ini]: https://en.wikipedia.org/wiki/INI_file
[env]: https://en.wikipedia.org/wiki/Environment_variable#Unix
[jinja2-cli]: https://github.com/mattrobenolt/jinja2-cli
[jinja2-undefined]: https://jinja.palletsprojects.com/en/2.10.x/api/#undefined-types

2 changes: 1 addition & 1 deletion j2cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def render_command(argv):
help='Load custom j2cli behavior from a Python file.')
parser.add_argument('--no-compact', action='store_true', dest='no_compact',
help='Do not compact space around Jinja2 blocks.')
parser.add_argument('-U', '--undefined', action='store', dest='undefined',
parser.add_argument('-U', '--undefined', default='strict', dest='undefined',
choices=UNDEFINED.keys(),
help='Set the Junja2 beahaviour for undefined variables.)')
parser.add_argument('-I', '--ignore-missing', action='store_true',
Expand Down

0 comments on commit 8a4d5b7

Please sign in to comment.