Update argument parsing

This commit is contained in:
Benjamin Collet 2021-02-10 15:01:42 +01:00
parent 129a8cab46
commit f125c39ba7
Signed by untrusted user who does not match committer: bcollet
GPG key ID: AD4777CCD7ED49DC

View file

@ -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')