mattrobenolt / jinja2-cli

CLI for Jinja2
BSD 2-Clause "Simplified" License
506 stars 181 forks source link

Support for overriding -D parameters with dot notation #83

Open atorrescogollo opened 4 years ago

atorrescogollo commented 4 years ago

Closes #82 : Feature request: parse -D parameters with dot notation.

Usage:

$ cat template.j2
Follow this steps:
1. Connect to {{ server }}
2. Enter the following credentials:
        {{ auth.username }}:{{ auth.password }}
3. Enjoy!
$ cat datasrc.yaml
server: https://myserver.com/myweb
auth:
  username: user
  password: s3cr3t
$ python3 jinja2-cli/jinja2cli/cli.py -D auth.username=admin template.j2 datasrc.yaml --format=yaml | tee README.txt
Follow this steps:
1. Connect to https://myserver.com/myweb
2. Enter the following credentials:
        admin:s3cr3t
3. Enjoy!