Allow portal-app-manager.py optional positional arguments

This commit is contained in:
Disassembler 2017-09-14 22:10:00 +02:00
parent 2f2047fb29
commit 55181587a5

View File

@ -20,11 +20,10 @@ def main(args):
with open(jsonfile, 'w') as f:
json.dump(data, f)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Spotter Cluster portal application manager')
parser.add_argument('app', help='Application ID.')
parser.add_argument('url', default=None, help='URL to the application. Use "{host}" as a host placeholder.')
parser.add_argument('login', default=None, help='Administrative login.')
parser.add_argument('password', default=None, help='Administrative password.')
parser.add_argument('url', nargs='?', help='URL to the application. Use "{host}" as a host placeholder.')
parser.add_argument('login', nargs='?', help='Administrative login.')
parser.add_argument('password', nargs='?', help='Administrative password.')
main(parser.parse_args())