Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -k/--keep option. #115

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ USAGE
Commandline usage: (if installed via pypi)
```
usage: chevron [-h] [-v] [-d DATA] [-p PARTIALS_PATH] [-e PARTIALS_EXT]
[-l DEF_LDEL] [-r DEF_RDEL]
[-l DEF_LDEL] [-r DEF_RDEL] [-w] [-k]
template

positional arguments:
Expand All @@ -55,6 +55,9 @@ optional arguments:
The default left delimiter, "{{" by default.
-r DEF_RDEL, --right-delimiter DEF_RDEL
The default right delimiter, "}}" by default.
-w, --warn Print a warning to stderr for each undefined template
key encountered
-k, --keep Keep undefined template keys unchanged
```

Python usage with strings
Expand Down
4 changes: 4 additions & 0 deletions chevron/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ def is_dir(arg):
help='Print a warning to stderr for each undefined template key encountered',
action='store_true')

parser.add_argument('-k', '--keep', dest='keep',
help='Keep undefined template keys unchanged',
action='store_true')


args = vars(parser.parse_args())

Expand Down
2 changes: 1 addition & 1 deletion chevron/metadata.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '0.13.1'
version = '0.13.2'