本文整理汇总了Python中Products.ZenUtils.ZenScriptBase.ZenScriptBase.parseOptions方法的典型用法代码示例。如果您正苦于以下问题:Python ZenScriptBase.parseOptions方法的具体用法?Python ZenScriptBase.parseOptions怎么用?Python ZenScriptBase.parseOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products.ZenUtils.ZenScriptBase.ZenScriptBase
的用法示例。
在下文中一共展示了ZenScriptBase.parseOptions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parseOptions
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import parseOptions [as 别名]
def parseOptions(self):
ZenScriptBase.parseOptions(self)
if not self.options.filename:
print "Required option output file is missing. Exiting..."
sys.exit(1)
if not self.options.zenpack:
print "Required option source zenpack is missing. Exiting..."
sys.exit(1)
示例2: parseOptions
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import parseOptions [as 别名]
def parseOptions(self):
ZenScriptBase.parseOptions(self)
if self.args:
if self.args == ['run']:
sys.stderr.write('Use of "run" is deprecated.\n')
elif self.args == ['help']:
sys.stderr.write('Use of "help" is deprecated,'
'use --help instead.\n')
self.parser.print_help()
self.parser.exit()
elif self.args[0]:
self.parser.error('Unrecognized option(s): %s\n' %
', '.join(self.args) +
'Use --help for list of options.\n')