From 7a4b051c1bc5331224f60c5c1604775b5238171e Mon Sep 17 00:00:00 2001 From: Patrick Elmer Date: Tue, 30 Aug 2022 15:39:39 +0900 Subject: [PATCH] Layout changes to readme --- README.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 941c1bc..b3c5767 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ Parse command line arguments into a list of args and a dict of kwargs. # Installation -`pip install pargs` +```python +pip install pargs +``` # Usage @@ -14,7 +16,6 @@ It can be used in the following way. ```python from pargs import parse_args - args, kwargs = parse_args() ``` @@ -23,19 +24,14 @@ The arguments to be parsed can also be specified manually: ```python from pargs import parse_args - args, kwargs = parse_args(argv=['pargs.py', '--name=Pargs']) ``` # Specification -`parse_args` parses arguments in the following way: +`parse_args` parses arguments in the following way, assuming the following command line arguments (`sys.argv`): -Assume the following command line arguments (`sys.argv`): - -```python -['/pargs/pargs.py', 'command', 'positional', '--flag', '--optional=value', 'test', '--output-file', 'filename', '-flg', 'name', 'name2'] -``` +`['/pargs/pargs.py', 'command', 'positional', '--flag', '--optional=value', 'test', '--output-file', 'filename', '-flg', 'name', 'name2']` By calling `args, kwargs = parse_args()`, this would return the following list and dict: