コード例 #1
0
ファイル: command.py プロジェクト: jimmack1963/lumberyard
def add_cli_commands(hook, subparsers, add_common_args, **kwargs):
    subparser = subparsers.add_parser(
        "cloud-gem-framework",
        help="Commands to manage CloudGems and CloudGem Portal")
    subparser.register('action', 'parsers',
                       resource_manager.cli.AliasedSubParsersAction)
    cgf_subparsers = subparser.add_subparsers(dest='subparser_name')

    resource_management.add_cli_commands(cgf_subparsers, add_common_args)
    swagger_processor.add_cli_commands(cgf_subparsers, add_common_args)
    cloud_gem_portal.add_cli_commands(cgf_subparsers, add_common_args)

    subparser = cgf_subparsers.add_parser(
        'generate-service-api-code',
        help=
        'Generate component and lambda function code to support a service API described by a swagger.json file provided by resource group.'
    )
    subparser.add_argument(
        '--resource-group',
        required=True,
        metavar='GROUP',
        help='The name of a resource group that provides a swagger.json file.')
    subparser.add_argument(
        '--component-client-path',
        required=False,
        default=None,
        help=
        'The path where the component client code will be written. Defaults to the '
        'Code\{game}\AWS\{group}\ServiceAPI directory, or the Gem\Code\AWS\ServiceAPI '
        'directory if the resource group is defined by a Gem.')
    add_common_args(subparser)
    subparser.set_defaults(func=__generate_service_api_code)
コード例 #2
0
def add_cli_commands(hook, subparsers, add_common_args, **kwargs):
    subparser = subparsers.add_parser(
        "cloud-gem-framework",
        help="Commands to manage CloudGems and CloudGem Portal",
        aliases=['cgf'])
    subparser.register('action', 'parsers',
                       resource_manager.cli.AliasedSubParsersAction)
    cgf_subparsers = subparser.add_subparsers(dest='subparser_name',
                                              metavar='COMMAND')

    resource_management.add_cli_commands(cgf_subparsers, add_common_args)
    swagger_processor.add_cli_commands(cgf_subparsers, add_common_args)
    cloud_gem_portal.add_cli_commands(cgf_subparsers, add_common_args)

    subparser = cgf_subparsers.add_parser(
        'generate-service-api-code',
        help=
        'Generate component and lambda function code to support a service API described by a swagger.json file provided by resource group.'
    )
    subparser.add_argument(
        '--gem',
        '-g',
        '--resource-group',
        '-r',
        required=True,
        metavar='GEM',
        help='The name of the gem that provides a swagger.json file.')
    subparser.add_argument(
        '--update-waf-files',
        required=False,
        action='store_true',
        help=
        'Causes the generated files to be added to the gem\'s .waf_files file.'
    )
    subparser.add_argument(
        '--component-client-path',
        required=False,
        default=None,
        help=
        'The path where the component client code will be written. Defaults to the '
        'Code\{game}\AWS\{group}\ServiceAPI directory, or the Gem\Code\AWS\ServiceAPI '
        'directory if the resource group is defined by a Gem.')
    subparser.add_argument(
        '--language',
        required=False,
        default='cpp',
        help='Language to generate for - options cpp, csharp')
    add_common_args(subparser)
    subparser.set_defaults(func=__generate_service_api_code)