Commit 1bad2948 authored by Janis Streib's avatar Janis Streib 🦉
Browse files

ADD: argparse util

parent 410db9b3
import argparse
server = 'www-net-devel.scc.kit.edu'
api_version = '3.0'
class ArgumentParser(argparse.ArgumentParser):
"""Argument parser with default common arguments for NetDB-api cli
tools. Includes default values."""
def __init__(self, formatter_class=argparse.ArgumentDefaultsHelpFormatter,
**kwargs):
super(ArgumentParser, self).__init__(formatter_class=formatter_class,
**kwargs)
self.add_argument('--token', '-t',
help='user API token')
self.add_argument('--server', '-s', default=server,
help='webapi server')
self.add_argument('--api-version', default=api_version,
help='webapi version')
def parse_args(self):
args = super(ArgumentParser, self).parse_args()
return args
...@@ -22,7 +22,7 @@ setup( ...@@ -22,7 +22,7 @@ setup(
version='1.0', version='1.0',
author='Dr. Meta', author='Dr. Meta',
description='This is a meta package to install the automatically generated NET-API 3.0 definitions.', description='This is a meta package to install the automatically generated NET-API 3.0 definitions.',
install_requires=['net_api_generator @ git+https://git.scc.kit.edu/scc-net/net-suite/api-generator.git@master'], install_requires=['net_api_generator @ git+https://git.scc.kit.edu/scc-net/net-suite/api-generator.git@master', 'argparse'],
setup_requires=['net_api_generator @ git+https://git.scc.kit.edu/scc-net/net-suite/api-generator.git@master'], setup_requires=['net_api_generator @ git+https://git.scc.kit.edu/scc-net/net-suite/api-generator.git@master'],
packages=['netdb_client'], packages=['netdb_client'],
cmdclass={'build_py': APIGenBuild} cmdclass={'build_py': APIGenBuild}
......
Markdown is supported
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