Skip to content

Commit 0946651

Browse files
authored
Merge pull request #62 from sykora/doc-fixes
Update README to reflect change in default config file parsing.
2 parents 3c80fe0 + cf26847 commit 0946651

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ class Args(Tap):
483483
args = Args(config_files=['my_config.txt']).parse_args()
484484
```
485485

486-
In addition, if `parse_config_files_with_shlex=True` is passed to `parse_args`, config files are pre-processed using the python standard library `shlex.split` method, which supports shell-style string quoting, as well as comments with `#`.
486+
Config files are parsed using `shlex.split` from the python standard library, which supports shell-style string quoting, as well as line-end comments starting with `#`.
487487

488488
For example, if you have the config file `my_config_shlex.txt`
489489
```
@@ -500,6 +500,8 @@ class Args(Tap):
500500
arg1: int
501501
arg2: str
502502

503-
args = Args(config_files=['my_config_shlex.txt']).parse_args(parse_config_files_with_shlex=True)
503+
args = Args(config_files=['my_config_shlex.txt']).parse_args()
504504
```
505505
to get the resulting `args = {'arg1': 21, 'arg2': 'two three four'}`
506+
507+
The legacy parsing behavior of using standard string split can be re-enabled by passing `legacy_config_parsing=True` to `parse_args`.

0 commit comments

Comments
 (0)