https://github.com/ondra6ak/argpar
A simple arguments parser.
https://github.com/ondra6ak/argpar
arguments command-line parser python3 simple
Last synced: 6 months ago
JSON representation
A simple arguments parser.
- Host: GitHub
- URL: https://github.com/ondra6ak/argpar
- Owner: ondra6ak
- Created: 2017-06-06T16:04:56.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-18T23:23:03.000Z (over 8 years ago)
- Last Synced: 2025-02-24T19:40:36.293Z (over 1 year ago)
- Topics: arguments, command-line, parser, python3, simple
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Argpar
======
A simple argument parser.
Usage
-----
```python
import argpar
import copy
import sys
opts = {"o": None, "g": "foo", "w": None}
flags = ["t", "u"]
posarg = {"path": "/home"}
argpar.parse(opts, copy.copy(sys.argv), flags, posarg)
```
Vaules in `opts` and `posarg` dictionaries are default values.
Will automaticaly print help message if a `h` flag is found and exit.
We recomend copying `sys.argv`, as arguments get removed during parsing.