Update argument parsing
This commit is contained in:
parent
129a8cab46
commit
f125c39ba7
1 changed files with 28 additions and 27 deletions
|
@ -125,6 +125,7 @@ def edit(args):
|
||||||
os.unlink(tmp_name)
|
os.unlink(tmp_name)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
|
||||||
# Arguments parsing
|
# Arguments parsing
|
||||||
# USAGE : ./ripe-api.py delete <TYPE> <KEY>
|
# USAGE : ./ripe-api.py delete <TYPE> <KEY>
|
||||||
|
@ -132,8 +133,8 @@ def edit(args):
|
||||||
# ./ripe-api.py update <TYPE> <KEY> <FILE>
|
# ./ripe-api.py update <TYPE> <KEY> <FILE>
|
||||||
# ./ripe-api.py get <TYPE> <KEY> <FILE>
|
# ./ripe-api.py get <TYPE> <KEY> <FILE>
|
||||||
# ./ripe-api.py edit <TYPE> <KEY>
|
# ./ripe-api.py edit <TYPE> <KEY>
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser(description='RIPE API client')
|
||||||
subparsers = parser.add_subparsers(help='Action to perform',dest='action')
|
subparsers = parser.add_subparsers(help='Action to perform',dest='action',required=True)
|
||||||
|
|
||||||
parser_get = subparsers.add_parser('get', help='Get an object')
|
parser_get = subparsers.add_parser('get', help='Get an object')
|
||||||
parser_get.add_argument('type', type=str, help='Object type')
|
parser_get.add_argument('type', type=str, help='Object type')
|
||||||
|
|
Loading…
Reference in a new issue