Commit 837b61aa authored by Stefan Mauerberger's avatar Stefan Mauerberger
Browse files

Use sphinx-argparse to document the CLI

parent c7ef04fa
Command line interface
======================
The modules will documented here ...
The python package `pymagglobal` also offers a utility command
.. argparse::
:module: pymagglobal.__main__
:func: argument_parser
:prog: pymagglobal
.. todo:: Use the epilog to provide `Example of use: ...` followed by th according figure.
......@@ -50,10 +50,8 @@ class ListModelsAction(argparse.Action):
parser.exit()
def main():
''' the main command of pymagglobal. it handles command line arguments and
calls the respective functions from the commands module.
'''
def argument_parser():
'''the argument parser'''
# the main parsing
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument('-h', '--help', action='help',
......@@ -165,6 +163,13 @@ def main():
help=f'input path to a model file. may be used to '
f'evaluate your own model. if given, this path will '
f'be used instead over the included files')
return parser
def main():
'''the main command of pymagglobal. it handles command line arguments and
calls the respective functions from the commands module.
'''
parser = argument_parser()
# parse the command line arguments
args = parser.parse_args()
# check whether model and input are consistent
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment