Skip to content

Single function

in a file named src.py

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from arger import Arger
from argparse import Namespace
from tests.utils import _reprint


def main(param1: int, param2: str, _namespace_: Namespace, kw1=None, kw2=False):
    """Example function with types documented in the docstring.

    :param param1: The first parameter.
    :param param2: The second parameter.
    :param kw1: this is optional parameter.
    :param kw2: this is boolean. setting flag sets True.
    """
    _reprint(**locals())


arger = Arger(
    main,
    prog='pytest',  # for testing purpose. otherwise not required
)

if __name__ == '__main__':
    arger.run()