From 1f9e42f2226802290b6f099a2252b4d1694d8916 Mon Sep 17 00:00:00 2001 From: Patrick Elmer Date: Sat, 19 Aug 2023 13:05:57 +0900 Subject: [PATCH] Update readme with new functionality () --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 108c685..83aedc5 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ args, kwargs = parse_args(argv=['pargv.py', '--name=pargv']) # Specification -`parse_args` parses arguments in the following way, assuming the following command line arguments (`sys.argv`): `['/pargv/pargv.py', 'command', 'positional', '--flag', '--optional=value', 'test', '--output-file', 'filename', '-ab', 'one', 'two']` +`parse_args` parses arguments in the following way, assuming the following command line arguments (`sys.argv`): `['/pargv/pargv.py', 'command', 'positional', '--flag', '--optional=value', 'test', '--output-file', 'filename', '-ab=one', 'two']` By calling `args, kwargs = parse_args()`, this would return the following list and dict: @@ -52,3 +52,4 @@ kwargs = { - One value of an option is stored as a string, multiple values are stored as a list - Flags are stored with the value `True` in the dict - Up to 2 leading hyphens are stripped from options, all other hyphens are converted into underscores (`---test-this-` would become the key `_test_this_` in the dict) +- For multiple short options such as `-vao=file.ext` or `-vao file.ext`, the last option (`o`) is set to the specified value, while other options (`v` and `a`) are set to `True`.