How to use the knack.arguments.enum_choice_list function in knack

To help you get started, we’ve selected a few knack examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-devops-cli-extension / azure-devops / azext_devops / dev / team / arguments.py View on Github external
'If no organization is specified, all organizations will be logged out.')

    with self.argument_context('devops configure') as context:
        context.argument('defaults', options_list=('--defaults', '-d'), nargs='*')
        context.argument('use_git_aliases', arg_type=get_three_state_flag())
        context.argument('list_config', options_list=('--list', '-l'))

    with self.argument_context('devops') as context:
        context.argument('repository', options_list=('--repository', '-r'))

    with self.argument_context('devops project') as context:
        context.argument('process', options_list=('--process', '-p'))
        context.argument('source_control', options_list=('--source-control', '-s'),
                         **enum_choice_list(_SOURCE_CONTROL_VALUES))
        context.argument('description', options_list=('--description', '-d'))
        context.argument('state', **enum_choice_list(_STATE_VALUES))
        context.argument('visibility', **enum_choice_list(_PROJECT_VISIBILITY_VALUES))

    with self.argument_context('devops project delete') as context:
        context.argument('yes', options_list=['--yes', '-y'], action='store_true',
                         help='Do not prompt for confirmation.')

    with self.argument_context('devops project list') as context:
        context.argument('state_filter', arg_type=get_enum_type(_PROJECT_GET_STATE_VALUE_FILTER),
                         help='State filter.')
        context.argument('continuation_token',
                         help='Continuation token. '
                         'This can be retrived from previous run of this command if more results are present.')
        context.argument('get_default_team_image_url', arg_type=get_three_state_flag(),
                         help='Whether to get default team image url or not.')

    with self.argument_context('devops service-endpoint create') as context:
github Azure / azure-devops-cli-extension / azure-devops / azext_devops / dev / team / arguments.py View on Github external
with self.argument_context('devops invoke') as context:
        context.argument('route_parameters', nargs='*',
                         help='Specifies the list of route parameters')
        context.argument('query_parameters', nargs='*',
                         help='Specifies the list of query parameters')
        context.argument('http_method', arg_type=get_enum_type(_HTTP_METHOD_VALUES),
                         help='Specifies the method used for the request.')
        context.argument('media_type',
                         help='Specifies the content type of the request.')
        context.argument('accept_media_type',
                         help='Specifies the content type of the response.')
        context.argument('in_file',
                         help='Path and file name to the file that contains the contents of the request.')
        context.argument('encoding',
                         help='Encoding of the input file. Used in conjunction with --in-file.',
                         **enum_choice_list(_FILE_ENCODING_TYPE_VALUES))
        context.argument('out_file',
                         help='Path and file name to the file  for which this function saves the response body.')
        context.argument('area',
                         help='The area to find the resource.')
        context.argument('resource',
                         help='The name of the resource to operate on.')
        context.argument('api_version',
                         help='The version of the API to target')

    with self.argument_context('devops user') as context:
        context.argument('license_type', arg_type=get_enum_type(_LICENSE_TYPES))
    with self.argument_context('devops user add') as context:
        context.argument('send_email_invite', arg_type=get_three_state_flag(),
                         help='Whether to send email invite for new user or not.')

    with self.argument_context('devops security group create') as context:
github Azure / azure-devops-cli-extension / src / command_modules / vsts-cli-team / vsts / cli / team / arguments.py View on Github external
ac.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
    with ArgumentsContext(cli_command_loader, 'configure') as ac:
        ac.argument('defaults', options_list=('--defaults', '-d'), nargs='*')
    with ArgumentsContext(cli_command_loader, 'project') as ac:
        ac.argument('team_instance', options_list=('--instance', '-i'))
        ac.argument('process', options_list=('--process', '-p'))
        ac.argument('source_control', options_list=('--source-control', '-s'),
                    **enum_choice_list(_SOURCE_CONTROL_VALUES))
        ac.argument('description', options_list=('--description', '-d'))
        ac.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
        ac.argument('state', **enum_choice_list(_STATE_VALUES))
        ac.argument('project_id', options_list='--id')
    with ArgumentsContext(cli_command_loader, 'configure') as ac:
        ac.argument('collect_telemetry', **enum_choice_list(_YES_NO_SWITCH_VALUES))
        ac.argument('enable_log_file', **enum_choice_list(_YES_NO_SWITCH_VALUES))
        ac.argument('use_git_aliases', **enum_choice_list(_YES_NO_SWITCH_VALUES))
        ac.argument('suppress_update_message', **enum_choice_list(_YES_NO_SWITCH_VALUES))
        ac.argument('default_output', **enum_choice_list(_OUTPUT_VALUES))
        ac.argument('list_config', options_list=('--list', '-l'))
github Azure / azure-devops-cli-extension / src / command_modules / vsts-cli-code / vsts / cli / code / arguments.py View on Github external
with ArgumentsContext(cli_command_loader, 'code pr work-items') as ac:
        ac.argument('work_items', nargs='+')
        
    with ArgumentsContext(cli_command_loader, 'code pr update') as ac:
        ac.argument('auto_complete', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
        ac.argument('squash', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
        ac.argument('delete_source_branch', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
        ac.argument('bypass_policy', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
        ac.argument('transition_work_items', **enum_choice_list(_ON_OFF_SWITCH_VALUES))

    with ArgumentsContext(cli_command_loader, 'code pr policies') as ac:
        ac.argument('evaluation_id', options_list=('--evaluation-id', '-e'))

    with ArgumentsContext(cli_command_loader, 'code pr set-vote') as ac:
        ac.argument('vote', **enum_choice_list(_VOTE_VALUES))

    with ArgumentsContext(cli_command_loader, 'code repo') as ac:
        ac.argument('repo_id', options_list='--id')
github Azure / azure-devops-cli-extension / src / command_modules / vsts-cli-team / vsts / cli / team / arguments.py View on Github external
ac.argument('defaults', options_list=('--defaults', '-d'), nargs='*')
    with ArgumentsContext(cli_command_loader, 'project') as ac:
        ac.argument('team_instance', options_list=('--instance', '-i'))
        ac.argument('process', options_list=('--process', '-p'))
        ac.argument('source_control', options_list=('--source-control', '-s'),
                    **enum_choice_list(_SOURCE_CONTROL_VALUES))
        ac.argument('description', options_list=('--description', '-d'))
        ac.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
        ac.argument('state', **enum_choice_list(_STATE_VALUES))
        ac.argument('project_id', options_list='--id')
    with ArgumentsContext(cli_command_loader, 'configure') as ac:
        ac.argument('collect_telemetry', **enum_choice_list(_YES_NO_SWITCH_VALUES))
        ac.argument('enable_log_file', **enum_choice_list(_YES_NO_SWITCH_VALUES))
        ac.argument('use_git_aliases', **enum_choice_list(_YES_NO_SWITCH_VALUES))
        ac.argument('suppress_update_message', **enum_choice_list(_YES_NO_SWITCH_VALUES))
        ac.argument('default_output', **enum_choice_list(_OUTPUT_VALUES))
        ac.argument('list_config', options_list=('--list', '-l'))
github Azure / azure-devops-cli-extension / src / command_modules / vsts-cli-build / vsts / cli / build / arguments.py View on Github external
def load_build_arguments(cli_command_loader):
    with ArgumentsContext(cli_command_loader, 'build') as ac:
        ac.argument('open_browser', options_list='--open')
        ac.argument('project', options_list=('--project', '-p'))
        ac.argument('team_instance', options_list=('--instance', '-i'))
        ac.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))

    with ArgumentsContext(cli_command_loader, 'build list') as ac:
        ac.argument('definition_ids', nargs='*', type=int)
        ac.argument('tags', nargs='*')

    with ArgumentsContext(cli_command_loader, 'build queue') as ac:
        ac.argument('definition_id', type=int)
        ac.argument('variables', nargs='*')

    with ArgumentsContext(cli_command_loader, 'build show') as ac:
        ac.argument('build_id', options_list='--id', type=int)

    with ArgumentsContext(cli_command_loader, 'build definition show') as ac:
        ac.argument('definition_id', options_list='--id', type=int)

    with ArgumentsContext(cli_command_loader, 'build task') as ac:
github Azure / azure-devops-cli-extension / src / command_modules / vsts-cli-code / vsts / cli / code / arguments.py View on Github external
with ArgumentsContext(cli_command_loader, 'code pr create') as ac:
        ac.argument('work_items', nargs='*')

    with ArgumentsContext(cli_command_loader, 'code pr list') as ac:
        ac.argument('status', **enum_choice_list(_PR_STATUS_VALUES))

    with ArgumentsContext(cli_command_loader, 'code pr reviewers') as ac:
        ac.argument('reviewers', nargs='+')

    with ArgumentsContext(cli_command_loader, 'code pr work-items') as ac:
        ac.argument('work_items', nargs='+')
        
    with ArgumentsContext(cli_command_loader, 'code pr update') as ac:
        ac.argument('auto_complete', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
        ac.argument('squash', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
        ac.argument('delete_source_branch', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
        ac.argument('bypass_policy', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
        ac.argument('transition_work_items', **enum_choice_list(_ON_OFF_SWITCH_VALUES))

    with ArgumentsContext(cli_command_loader, 'code pr policies') as ac:
        ac.argument('evaluation_id', options_list=('--evaluation-id', '-e'))

    with ArgumentsContext(cli_command_loader, 'code pr set-vote') as ac:
        ac.argument('vote', **enum_choice_list(_VOTE_VALUES))

    with ArgumentsContext(cli_command_loader, 'code repo') as ac:
        ac.argument('repo_id', options_list='--id')
github Azure / azure-devops-cli-extension / azure-devops / azext_devops / dev / pipelines / arguments.py View on Github external
type=str.lower)

    with self.argument_context('pipelines runs list') as context:
        context.argument('pipeline_ids', nargs='*', type=int)
        context.argument('tags', nargs='*')
        context.argument('reason', **enum_choice_list(_BUILD_REASON_VALUES))
        context.argument('result', **enum_choice_list(_BUILD_RESULT_VALUES))
        context.argument('status', **enum_choice_list(_BUILD_STATUS_VALUES))
        context.argument('query_order', **enum_choice_list(_PIPELINES_RUNS_QUERY_ORDER))

    with self.argument_context('pipelines run') as context:
        context.argument('id', type=int)
        context.argument('variables', nargs='*')

    with self.argument_context('pipelines list') as context:
        context.argument('query_order', **enum_choice_list(_PIPELINES_QUERY_ORDER))
        context.argument(
            'repository_type',
            choices=['tfsversioncontrol', 'tfsgit', 'git', 'github', 'githubenterprise', 'bitbucket', 'svn'],
            type=str.lower)

    with self.argument_context('pipelines create') as context:
        context.argument('repository_type', choices=['tfsgit', 'github'], type=str.lower)
        context.argument('yml_path', options_list=('--yml-path', '--yaml-path'))
        context.argument('skip_first_run', options_list=['--skip-first-run', '--skip-run'],
                         arg_type=get_three_state_flag())

    with self.argument_context('pipelines update') as context:
        context.argument('yml_path', options_list=('--yml-path', '--yaml-path'))
        context.argument('name', deprecate_info=context.deprecate(redirect='--id', target='--name', hide=True))

    with self.argument_context('pipelines pool') as context:
github Azure / azure-devops-cli-extension / src / command_modules / vsts-cli-code / vsts / cli / code / arguments.py View on Github external
ac.argument('reviewers', nargs='*')
        ac.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))

    with ArgumentsContext(cli_command_loader, 'code pr') as ac:
        ac.argument('description', type=str, options_list=('--description', '-d'), nargs='*')
        ac.argument('pull_request_id', type=int, options_list='--id')
        ac.argument('repository', options_list=('--repository', '-r'))
        ac.argument('source_branch', options_list=('--source-branch', '-s'))
        ac.argument('target_branch', options_list=('--target-branch', '-t'))
        ac.argument('title', type=str)

    with ArgumentsContext(cli_command_loader, 'code pr create') as ac:
        ac.argument('work_items', nargs='*')

    with ArgumentsContext(cli_command_loader, 'code pr list') as ac:
        ac.argument('status', **enum_choice_list(_PR_STATUS_VALUES))

    with ArgumentsContext(cli_command_loader, 'code pr reviewers') as ac:
        ac.argument('reviewers', nargs='+')

    with ArgumentsContext(cli_command_loader, 'code pr work-items') as ac:
        ac.argument('work_items', nargs='+')
        
    with ArgumentsContext(cli_command_loader, 'code pr update') as ac:
        ac.argument('auto_complete', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
        ac.argument('squash', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
        ac.argument('delete_source_branch', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
        ac.argument('bypass_policy', **enum_choice_list(_ON_OFF_SWITCH_VALUES))
        ac.argument('transition_work_items', **enum_choice_list(_ON_OFF_SWITCH_VALUES))

    with ArgumentsContext(cli_command_loader, 'code pr policies') as ac:
        ac.argument('evaluation_id', options_list=('--evaluation-id', '-e'))
github Azure / azure-devops-cli-extension / src / command_modules / vsts-cli-work / vsts / cli / work / arguments.py View on Github external
def load_work_arguments(cli_command_loader):
    with ArgumentsContext(cli_command_loader, 'work') as ac:
        ac.argument('open_browser', options_list='--open')
        ac.argument('project', options_list=('--project', '-p'))
        ac.argument('team_instance', options_list=('--instance', '-i'))
        ac.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))

    with ArgumentsContext(cli_command_loader, 'work item') as ac:
        ac.argument('work_item_id', type=int, options_list='--id')
        ac.argument('work_item_type', type=str, options_list='--type')
        ac.argument('fields', nargs='*', options_list=('--fields', '-f'))
        ac.argument('description', options_list=('--description', '-d'))

    with ArgumentsContext(cli_command_loader, 'work item query') as ac:
        ac.argument('query_id', type=str, options_list='--id')