dgcm/dgcm/main.py

36 lines
1.8 KiB
Python

"""The Dazed Gerbil Connection Manager"""
import argparse
def main():
parser = argparse.ArgumentParser(prog='dgcm',
# usage='dgcm [OPTIONS]...',
description='The Dazed Gerbil Connection Manager')
command_group = parser.add_argument_group('Command options')
command_group.add_argument('-a', '--add', action='store_true', help='add a new connection')
command_group.add_argument('-l', '--list', action='store_true', help='list the existing connections')
command_group.add_argument('-c', '--connect', action='store_true', help='connect to an existing connection')
command_group.add_argument('-r', '--remove', action='store_true', help='remove an existing connection')
command_group.add_argument('-u', '--update', action='store_true', help='update an existing connection')
connection_group = parser.add_argument_group('Connection options')
connection_group.add_argument('-U', '--user', help='the user to connect as')
connection_group.add_argument('-H', '--host', help='specify the host for the connection')
connection_group.add_argument('-P', '--port', help='specify the port if non-standard')
connection_group.add_argument('-S', '--shortname', help='provide a short name for faster access')
mutually_exclusive_group = parser.add_mutually_exclusive_group()
mutually_exclusive_group.add_argument('-v', '--verbose', action='count', default=0, help='increase output verbosity')
mutually_exclusive_group.add_argument('-q', '--quiet', action='store_true', help='disable output')
parser.add_argument('connection', action='store_false', help='shortname of the connection to use')
args = parser.parse_args()
print(args)
if __name__ == '__main__':
main()