MCPcopy Create free account
hub / github.com/apache/cloudstack / parse_args

Method parse_args

cloud-cli/cloudtool/utils.py:52–64  ·  view source on GitHub ↗
(self,*args,**kwargs)

Source from the content-addressed store, hash-verified

50 self.exit(os.EX_USAGE)
51
52 def parse_args(self,*args,**kwargs):
53 options,arguments = OptionParser.parse_args(self,*args,**kwargs)
54
55 def prune_options(options,alist):
56 """Given 'options' -- a list of arguments to OptionParser.add_option,
57 and a set of optparse Values, return a dictionary of only those values
58 that apply exclusively to 'options'"""
59 return dict( [ (k,getattr(options,k)) for k in dir(options) if k in alist ] )
60
61 api_options = prune_options(options,self.api_dests)
62 cmd_options = prune_options(options,self.cmd_dests)
63
64 return options,arguments,api_options,cmd_options
65
66
67def get_parser(api_callable=None,cmd_callable=None): # this should probably be the __init__ method of myoptionparser

Callers 15

devcloud-kvm.pyFile · 0.80
_generate_argsFunction · 0.80
mainFunction · 0.80
configGenerator.pyFile · 0.80
codegenerator.pyFile · 0.80
advancedsg_env.pyFile · 0.80
basic_env.pyFile · 0.80
advanced_env.pyFile · 0.80
simulator_setup.pyFile · 0.80
set_redundant.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected