• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python argumentParser.ArgumentParser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: arg_export

 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,代码行数:7,代码来源:template.py


示例2: arg_import

 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,代码行数:33,代码来源:template.py


示例3: arg_info

 def arg_info(self):
     do_parser = ArgumentParser(prog=self.cmd_name + " info", add_help=True,
                                description="Displays detailed information about a machine image")
     mandatory = do_parser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id', dest='id', type=str, required=True,
                            help="the ID of the machine image to retrieve")
     return do_parser
开发者ID:usharesoft,项目名称:hammr,代码行数:7,代码来源:image.py


示例4: arg_list

 def arg_list(self):
     do_parser = ArgumentParser(prog=self.cmd_name + " list", add_help=True,
                                description="List the vendors registered to the marketplace")
     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:pedrolegold,项目名称:marketplace-cli,代码行数:7,代码来源:vendorcmds.py


示例5: arg_launch

 def arg_launch(self):
     do_parser = ArgumentParser(prog=self.cmd_name + " launch", add_help=True,
                               description="Launches a migration")
     mandatory = do_parser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--file', dest='file', required=True,
                            help="yaml/json file providing the migration configuration")
     return do_parser
开发者ID:lqueiroga,项目名称:hammr,代码行数:7,代码来源:migration.py


示例6: arg_info

        def arg_info(self):
                doParser = ArgumentParser(add_help = True, description="Get info on provided organization")

                optional = doParser.add_argument_group("optional arguments")

                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,代码行数:7,代码来源:org.py


示例7: arg_add

    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,代码行数:28,代码来源:org_os.py


示例8: arg_create

 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,代码行数:7,代码来源:bundle.py


示例9: arg_update

    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,代码行数:32,代码来源:org_repo.py


示例10: arg_clone

 def arg_clone(self):
     doParser = ArgumentParser(prog=self.cmd_name+" clone", add_help = True, description="Clones the bundle. The clone is copying the meta-data of the bundle")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id', dest='id', required=True, help="the ID of the bundle to clone")
     mandatory.add_argument('--name', dest='name', required=True, help="the name to use for the new cloned bundle")
     mandatory.add_argument('--version', dest='version', required=True, help="the version to use for the cloned bundle")
     return doParser
开发者ID:lqueiroga,项目名称:hammr,代码行数:7,代码来源:bundle.py


示例11: arg_publish

 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,代码行数:7,代码来源:image.py


示例12: arg_create

 def arg_create(self):
     doParser = ArgumentParser(prog=self.cmd_name + " create", add_help=True,
                               description="Creates a new cloud account")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--file', dest='file', required=True,
                            help="yaml/json file providing the cloud account parameters")
     return doParser
开发者ID:jgweir,项目名称:hammr,代码行数:7,代码来源:account.py


示例13: arg_add

    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,代码行数:25,代码来源:role_entitlement.py


示例14: arg_list

        def arg_list(self):
                doParser = ArgumentParser(add_help=True,description="List enabled operating systems for provided user")

                mandatory = doParser.add_argument_group("mandatory arguments")

                mandatory.add_argument('--account', dest='account', type=str, required=True, help="User name of the account for which the current command should be executed")
                return doParser
开发者ID:DimitriSCOLE,项目名称:uforge-cli,代码行数:7,代码来源:user_os.py


示例15: arg_disable

    def arg_disable(self):
        doParser = ArgumentParser(prog=self.cmd_name + " disable", add_help=True, description="Disable provided user")
        mandatory = doParser.add_argument_group("mandatory arguments")

        mandatory.add_argument('--account', dest='account', required=True,
                               help="user name of the account for which the current command should be executed")
        return doParser
开发者ID:pedrolegold,项目名称:marketplace-cli,代码行数:7,代码来源:usercmds.py


示例16: arg_export

 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,代码行数:8,代码来源:bundle.py


示例17: arg_list

        def arg_list(self):
                doParser = ArgumentParser(add_help = True, description="List all the formats (enabled and disabled) for the provided organization")

                optional = doParser.add_argument_group("optional arguments")

                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:DimitriSCOLE,项目名称:uforge-cli,代码行数:8,代码来源:org_format.py


示例18: arg_info

        def arg_info(self):
                doParser = ArgumentParser(add_help = True, description="Set the quota of api keys the user can create")

                mandatory = doParser.add_argument_group("mandatory arguments")

                mandatory.add_argument('--account', dest='account', type=str, required=True, help="User name of the account for which the current command should be executed")

                return doParser
开发者ID:DimitriSCOLE,项目名称:uforge-cli,代码行数:8,代码来源:user_api.py


示例19: arg_delete

 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,代码行数:8,代码来源:template.py


示例20: arg_remove

        def arg_remove(self):
                do_parser = ArgumentParser(prog=self.cmd_name + " remove", add_help=True, description="Remove one or more entitlements to a role within the specified organization")

                mandatory = do_parser.add_argument_group("mandatory arguments")

                mandatory.add_argument('--account', dest='account', required=True, help="user name of the account for which the current command should be executed")
                mandatory.add_argument('--roles', dest='roles', nargs='+', required=True, help="a list of roles to be removed (example: --roles \"role1 role2 role3\").")
                return do_parser
开发者ID:DimitriSCOLE,项目名称:uforge-cli,代码行数:8,代码来源:user_role.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python generics_utils.order_list_object_by函数代码示例发布时间:2022-05-27
下一篇:
Python usocket.socket函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap