Commit 1bad2948 authored by janis.streib's avatar janis.streib 🦉
Browse files

ADD: argparse util

parent 410db9b3
import argparse
server = ''
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,
super(ArgumentParser, self).__init__(formatter_class=formatter_class,
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(
author='Dr. Meta',
description='This is a meta package to install the automatically generated NET-API 3.0 definitions.',
install_requires=['net_api_generator @ git+'],
install_requires=['net_api_generator @ git+', 'argparse'],
setup_requires=['net_api_generator @ git+'],
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