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: