def build_arg_parser():
 parser = argparse.ArgumentParser(description='Standard Arguments for talking to vCenter')
 parser.add_argument('-s', '--host', required=True, action='store', help='vSphere service to connect to')
 parser.add_argument('-o', '--port', type=int, default=443, action='store', help='Port to connect on')
 parser.add_argument('-u', '--user', required=True, action='store', help='User name to use when connecting to host')
 parser.add_argument('-p', '--password', required=False, action='store', help='Password to use when connecting to host')
 return parser

def build_arg_parser ( ) : parser = argparse . ArgumentParser ( description = 'Standard Arguments for talking to vCenter' ) parser . add_argument ( '-s' , '--host' , required = True , action = 'store' , help = 'vSphere service to connect to' ) parser . add_argument ( '-o' , '--port' , type = int , default = 443 , action = 'store' , help = 'Port to connect on' ) parser . add_argument ( '-u' , '--user' , required = True , action = 'store' , help = 'User name to use when connecting to host' ) parser . add_argument ( '-p' , '--password' , required = False , action = 'store' , help = 'Password to use when connecting to host' ) return parser
builds a standard argument parser with arguments for talking to vcenter -s service_host_name_or_ip -o optional_port_number -u required_user -p optional_password .