当前位置: 首页>>代码示例>>Python>>正文


Python ArgumentParser.add_argument_group方法代码示例

本文整理汇总了Python中ussclicore.argumentParser.ArgumentParser.add_argument_group方法的典型用法代码示例。如果您正苦于以下问题:Python ArgumentParser.add_argument_group方法的具体用法?Python ArgumentParser.add_argument_group怎么用?Python ArgumentParser.add_argument_group使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ussclicore.argumentParser.ArgumentParser的用法示例。


在下文中一共展示了ArgumentParser.add_argument_group方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: arg_create

# 需要导入模块: from ussclicore.argumentParser import ArgumentParser [as 别名]
# 或者: from ussclicore.argumentParser.ArgumentParser import add_argument_group [as 别名]
 def arg_create(self):
     doParser = ArgumentParser(prog=self.cmd_name+" create", add_help = True, description="Create a new bundle and save to the UForge server")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--file', dest='file', required=True, help="yaml/json file containing the bundle content")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument('--archive-path', dest='archive_path', required=False, help="path of where to store the archive of the created bundle. If provided hammr, creates an archive of the created bundle, equivalent to running bundle export")
     return doParser
开发者ID:lqueiroga,项目名称:hammr,代码行数:9,代码来源:bundle.py

示例2: arg_export

# 需要导入模块: from ussclicore.argumentParser import ArgumentParser [as 别名]
# 或者: from ussclicore.argumentParser.ArgumentParser import add_argument_group [as 别名]
 def arg_export(self):
     doParser = ArgumentParser(prog=self.cmd_name+" export", add_help = True, description="Exports a template by creating an archive (compressed tar file) that includes the json template configuration file")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id', dest='id', required=True, help="the ID of the template to export")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument('--file', dest='file', required=False, help="destination path where to store the template configuration file on the local filesystem")
     return doParser
开发者ID:ShigeruIchihashi,项目名称:hammr,代码行数:9,代码来源:template.py

示例3: arg_add

# 需要导入模块: from ussclicore.argumentParser import ArgumentParser [as 别名]
# 或者: from ussclicore.argumentParser.ArgumentParser import add_argument_group [as 别名]
    def arg_add(self):
        doParser = ArgumentParser(add_help=True, description="Add an operating system for the provided organization")

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument(
            "--arch", dest="arch", type=str, required=True, help="Operating system architecture (i386, x86_64)."
        )
        mandatory.add_argument(
            "--name",
            dest="name",
            type=str,
            required=True,
            help="Operating system(s) name (for example CentOS, Debian etc) for which the current command should be executed.",
        )
        mandatory.add_argument(
            "--version", dest="version", type=str, required=True, help="Operating system version (13, 5.6, ...)"
        )
        optional.add_argument(
            "--org",
            dest="org",
            type=str,
            required=False,
            help="The organization name. If no organization is provided, then the default organization is used.",
        )

        return doParser
开发者ID:jbremond,项目名称:uforge-cli,代码行数:30,代码来源:org_os.py

示例4: arg_add

# 需要导入模块: from ussclicore.argumentParser import ArgumentParser [as 别名]
# 或者: from ussclicore.argumentParser.ArgumentParser import add_argument_group [as 别名]
    def arg_add(self):
        doParser = ArgumentParser(
            prog=self.cmd_name + " add",
            add_help=True,
            description="Add one or more entitlements to a role within the specified organization",
        )

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument("--name", dest="name", required=True, help="The name of role")
        mandatory.add_argument(
            "--entitlements",
            dest="entitlements",
            nargs="+",
            required=True,
            help="List of entitlements to add to a role. You can use Unix matching system (*,?,[seq],[!seq]) and multiple match separating by space.",
        )
        optional.add_argument(
            "--org",
            dest="org",
            required=False,
            help="The organization name. If no organization is provided, then the default organization is used.",
        )
        return doParser
开发者ID:jbremond,项目名称:uforge-cli,代码行数:27,代码来源:role_entitlement.py

示例5: arg_import

# 需要导入模块: from ussclicore.argumentParser import ArgumentParser [as 别名]
# 或者: from ussclicore.argumentParser.ArgumentParser import add_argument_group [as 别名]
 def arg_import(self):
     doParser = ArgumentParser(
         prog=self.cmd_name + " import", add_help=True, description="Creates a template from an archive"
     )
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument("--file", dest="file", required=True, help="the path of the archive")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument(
         "-f",
         "--force",
         dest="force",
         action="store_true",
         help="force template creation (delete template/bundle if already exist)",
         required=False,
     )
     optional.add_argument(
         "-r",
         "--rbundles",
         dest="rbundles",
         action="store_true",
         help="if a bundle already exists, use it in the new template. Warning: this option ignore the content of the bundle described in the template file",
         required=False,
     )
     optional.add_argument(
         "--usemajor",
         dest="use_major",
         action="store_true",
         help="use distribution major version if exit",
         required=False,
     )
     optional.set_defaults(force=False)
     optional.set_defaults(use_major=False)
     return doParser
开发者ID:usharesoft,项目名称:hammr,代码行数:35,代码来源:template.py

示例6: arg_publish

# 需要导入模块: from ussclicore.argumentParser import ArgumentParser [as 别名]
# 或者: from ussclicore.argumentParser.ArgumentParser import add_argument_group [as 别名]
 def arg_publish(self):
     doParser = ArgumentParser(prog=self.cmd_name+" publish", add_help = True, description="Publish (upload and register) a built machine image to a target environment")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--file', dest='file', required=True, help="json file providing the cloud account parameters required for upload and registration")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument('--id',dest='id',required=False, help="id of the image to publish")
     return doParser
开发者ID:hidakanoko,项目名称:hammr,代码行数:9,代码来源:image.py

示例7: arg_update

# 需要导入模块: from ussclicore.argumentParser import ArgumentParser [as 别名]
# 或者: from ussclicore.argumentParser.ArgumentParser import add_argument_group [as 别名]
    def arg_update(self):
        doParser = ArgumentParser(add_help=True, description="Update a repository in the organisation")

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument(
            "--id", dest="id", type=int, required=True, help="Id of the repository to update in the organization."
        )
        optional.add_argument(
            "--repoUrl",
            dest="repoUrl",
            type=str,
            required=False,
            help="Url of the repository to update in the organization.",
        )
        optional.add_argument(
            "--type",
            dest="type",
            type=str,
            required=False,
            help="Type of the repository to update in the organization.",
        )
        optional.add_argument(
            "--org",
            dest="org",
            type=str,
            required=False,
            help="The organization name. If no organization is provided, then the default organization is used.",
        )

        return doParser
开发者ID:pedrolegold,项目名称:uforge-cli,代码行数:34,代码来源:org_repo.py

示例8: arg_export

# 需要导入模块: from ussclicore.argumentParser import ArgumentParser [as 别名]
# 或者: from ussclicore.argumentParser.ArgumentParser import add_argument_group [as 别名]
 def arg_export(self):
     doParser = ArgumentParser(prog=self.cmd_name+" export", add_help = True, description="Exports a bundle by creating an archive (compressed tar file) that includes the bundle configuration file")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id', dest='id', required=True, help="the ID of the bundle to export")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument('--file', dest='file', required=False, help="destination path where to store the bundle configuration file on the local filesystem")
     optional.add_argument('--outputFormat', dest='output_format', required=False, help="output format (yaml or json) of the bundle file to export (yaml is the default one)")
     return doParser
开发者ID:lqueiroga,项目名称:hammr,代码行数:10,代码来源:bundle.py

示例9: arg_delete

# 需要导入模块: from ussclicore.argumentParser import ArgumentParser [as 别名]
# 或者: from ussclicore.argumentParser.ArgumentParser import add_argument_group [as 别名]
 def arg_delete(self):
     doParser = ArgumentParser(prog=self.cmd_name+" delete", add_help = True, description="Deletes an existing template")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id', dest='id', required=True, help="the ID of the template to delete")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument('--no-confirm',dest='no_confirm',action='store_true', required=False, help="do not print confirmation dialog")
     optional.set_defaults(no_confirm=False)
     return doParser
开发者ID:ShigeruIchihashi,项目名称:hammr,代码行数:10,代码来源:template.py

示例10: arg_download

# 需要导入模块: from ussclicore.argumentParser import ArgumentParser [as 别名]
# 或者: from ussclicore.argumentParser.ArgumentParser import add_argument_group [as 别名]
 def arg_download(self):
     doParser = ArgumentParser(prog=self.cmd_name + " download", add_help=True,
                               description="Downloads a machine image to the local filesystem")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id', dest='id', required=True, help="the ID of the machine image to download")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument('--file', dest='file', required=False,
                            help="the pathname where to store the machine image")
     return doParser
开发者ID:usharesoft,项目名称:hammr,代码行数:11,代码来源:image.py

示例11: arg_info

# 需要导入模块: from ussclicore.argumentParser import ArgumentParser [as 别名]
# 或者: from ussclicore.argumentParser.ArgumentParser import add_argument_group [as 别名]
 def arg_info(self):
     do_parser = ArgumentParser(prog=self.cmd_name + " info", add_help=True,
                                description="Prints out all the details of a specified role within an organization")
     mandatory = do_parser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--name', dest='name', required=True, help="name of the role")
     optional = do_parser.add_argument_group("optional arguments")
     optional.add_argument('--org', dest='org', required=False,
                           help="the organization name. If no organization is provided, then the default organization is used.")
     return do_parser
开发者ID:hugo6,项目名称:marketplace-cli,代码行数:11,代码来源:rolecmds.py

示例12: arg_delete

# 需要导入模块: from ussclicore.argumentParser import ArgumentParser [as 别名]
# 或者: from ussclicore.argumentParser.ArgumentParser import add_argument_group [as 别名]
 def arg_delete(self):
     do_parser = ArgumentParser(prog=self.cmd_name + " delete", add_help=True,
                                description="Delete a role from the specified organization")
     mandatory = do_parser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--name', dest='name', required=True, help="name of the role")
     optional = do_parser.add_argument_group("optional arguments")
     optional.add_argument('--org', dest='org', required=False,
                           help="the organization name. If no organization is provided, then the default organization is used.")
     return do_parser
开发者ID:hugo6,项目名称:marketplace-cli,代码行数:11,代码来源:rolecmds.py

示例13: arg_info

# 需要导入模块: from ussclicore.argumentParser import ArgumentParser [as 别名]
# 或者: from ussclicore.argumentParser.ArgumentParser import add_argument_group [as 别名]
        def arg_info(self):
                doParser = ArgumentParser(prog=self.cmd_name + " info", add_help=True, description="Get detailed information on a subscription profile within an organization.")

                mandatory = doParser.add_argument_group("mandatory arguments")
                optional = doParser.add_argument_group("optional arguments")

                mandatory.add_argument('--name', dest='name', required=True, help="The name of the subscription profile")
                optional.add_argument('--org', dest='org', required=False, help="The organization name. If no organization is provided, then the default organization is used.")
                return doParser
开发者ID:DimitriSCOLE,项目名称:uforge-cli,代码行数:11,代码来源:subscription.py

示例14: arg_disable

# 需要导入模块: from ussclicore.argumentParser import ArgumentParser [as 别名]
# 或者: from ussclicore.argumentParser.ArgumentParser import add_argument_group [as 别名]
        def arg_disable(self):
                doParser = ArgumentParser(prog=self.cmd_name + " disable", add_help=True, description="Disables a subscription profile within an organization (cannot be used to reate users).")

                mandatory = doParser.add_argument_group("mandatory arguments")
                optional = doParser.add_argument_group("optional arguments")

                mandatory.add_argument('--name', dest='name', required=True, help="The name of the subscription profile to update")
                optional.add_argument('--org', dest='org', required=False, help="The organization name. If no organization is provided, then the default organization is used.")
                return doParser
开发者ID:DimitriSCOLE,项目名称:uforge-cli,代码行数:11,代码来源:subscription.py

示例15: arg_batch

# 需要导入模块: from ussclicore.argumentParser import ArgumentParser [as 别名]
# 或者: from ussclicore.argumentParser.ArgumentParser import add_argument_group [as 别名]
 def arg_batch(self):
         doParser = ArgumentParser("batch", add_help = False, description="Execute uforge-cli batch command from a file (for scripting)")
         mandatory = doParser.add_argument_group("mandatory arguments")
         optionnal = doParser.add_argument_group("optional arguments")
         mandatory.add_argument('--file', dest='file', required=True, help="uforge-cli batch file commands")
         optionnal.add_argument('-f', '--fatal', dest='fatal', action='store_true',required=False, help="exit on first error in batch file (default is to continue)")
         # Help is not call at the doParser declaration because it would create two separate argument group for optional arguments.
         optionnal.add_argument('-h', '--help', action='help', help="show this help message and exit")
         return doParser
开发者ID:hugo6,项目名称:uforge-cli,代码行数:11,代码来源:uforgecli.py


注:本文中的ussclicore.argumentParser.ArgumentParser.add_argument_group方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。