def get_args():
    parser = argparse.ArgumentParser()

    parser.add_argument('-s', '--host',
                        required=True, action='store',
                        help='vCenter Server address')

    parser.add_argument('-o', '--port',
                        type=int, default=443,
                        action='store', help='Port to connect to')

    parser.add_argument('-u', '--user',
                        required=True, action='store',
                        help='User name to use for the connection')

    parser.add_argument('-p', '--password',
                        required=False, action='store',
                        help='Password to use for the connection')

    parser.add_argument('-e', '--esx_host',
                        required=True, action='store',
                        help='Host to reconfigure')

    args = parser.parse_args()

    if not args.password:
        args.password = getpass.getpass(
            prompt='Enter password for user %s: ' % args.user)

    return args
Retrieve data from an sqlite3 db (returns all rows, be careful!)
dataset/ETHPy150Open vmware/pyvmomi-community-samples/samples/reconfigure_host_for_ha.py/get_args--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/sqlite3.py/fetch