betterargs
A tool to create a command-line interface for your app using python
Installation
pip install betterargs
Releases
Packaging and releases are handled in the packaging branch.
MAIN BRANCH IS RESERVED FOR MAINTAINING CODE ONLY!!!
Usage
git:
args:
path:
atype: flag
help: Path of the repo
subparsers:
parsers:
clone:
args:
quiet-clone:
atype: flag
help: Operate quietly. Progress is not reported to the standard error stream.
no-checkout:
help: No checkout of HEAD is performed after the clone is complete
init:
args:
quiet-init:
atype: flag
help: Operate quietly. Progress is not reported to the standard error stream.
import betterargs
command_tree_PATH = 'command_tree.yaml'
args = betterargs.format_path_tree(command_tree_PATH)
import betterargs
command_tree_DICT = {
"git": {
"args": {
"path": {
"atype": "flag",
"help": "Path of the repo",
},
},
"subparsers": {
"parsers": {
"clone": {
"args": {
"quiet-clone": {
"atype": "flag",
"help": "Operate quietly. Progress is not reported to the standard error stream.",
},
"no-checkout": {
"help": "No checkout of HEAD is performed after the clone is complete"
},
},
},
"init": {
"args": {
"quiet-init": {
"atype": "flag",
"help": "Operate quietly. Progress is not reported to the standard error stream.",
},
},
},
},
},
},
}
args = betterargs.format_dict_tree(command_tree_DICT)
import betterargs
command_tree_STR = """
git:
args:
path:
atype: flag
help: Path of the repo
subparsers:
parsers:
clone:
args:
quiet-clone:
atype: flag
help: Operate quietly. Progress is not reported to the standard error stream.
no-checkout:
help: No checkout of HEAD is performed after the clone is complete
init:
args:
quiet-init:
atype: flag
help: Operate quietly. Progress is not reported to the standard error stream.
"""
args = betterargs.format_str_tree(command_tree_STR)
Contributors
Contribution
You are more than welcome to contribute 😊
Process
It's simple!!!
-
Fork the github repo
-
Clone the github repo
git clone https://github.com/danielmuringe/betterargs
Rules
Other rules will be added at my discretion
Tests
Documentation
Coming Soon 😊