OpenQuizz
Une application de gestion des contenus pédagogiques
click._bashcomplete Namespace Reference

Functions

def get_completion_script (prog_name, complete_var, shell)
 
def resolve_ctx (cli, prog_name, args)
 
def start_of_option (param_str)
 
def is_incomplete_option (all_args, cmd_param)
 
def is_incomplete_argument (current_params, cmd_param)
 
def get_user_autocompletions (ctx, args, incomplete, cmd_param)
 
def get_visible_commands_starting_with (ctx, starts_with)
 
def add_subcommand_completions (ctx, incomplete, completions_out)
 
def get_choices (cli, prog_name, args, incomplete)
 
def do_complete (cli, prog_name, include_descriptions)
 
def do_complete_fish (cli, prog_name)
 
def bashcomplete (cli, prog_name, complete_var, complete_instr)
 

Variables

string WORDBREAK = "="
 
string COMPLETION_SCRIPT_BASH
 
string COMPLETION_SCRIPT_ZSH
 
tuple COMPLETION_SCRIPT_FISH
 

Function Documentation

◆ add_subcommand_completions()

def click._bashcomplete.add_subcommand_completions (   ctx,
  incomplete,
  completions_out 
)

◆ bashcomplete()

def click._bashcomplete.bashcomplete (   cli,
  prog_name,
  complete_var,
  complete_instr 
)

◆ do_complete()

def click._bashcomplete.do_complete (   cli,
  prog_name,
  include_descriptions 
)

◆ do_complete_fish()

def click._bashcomplete.do_complete_fish (   cli,
  prog_name 
)

◆ get_choices()

def click._bashcomplete.get_choices (   cli,
  prog_name,
  args,
  incomplete 
)
:param cli: command definition
:param prog_name: the program that is running
:param args: full list of args
:param incomplete: the incomplete text to autocomplete
:return: all the possible completions for the incomplete

◆ get_completion_script()

def click._bashcomplete.get_completion_script (   prog_name,
  complete_var,
  shell 
)

◆ get_user_autocompletions()

def click._bashcomplete.get_user_autocompletions (   ctx,
  args,
  incomplete,
  cmd_param 
)
:param ctx: context associated with the parsed command
:param args: full list of args
:param incomplete: the incomplete text to autocomplete
:param cmd_param: command definition
:return: all the possible user-specified completions for the param

◆ get_visible_commands_starting_with()

def click._bashcomplete.get_visible_commands_starting_with (   ctx,
  starts_with 
)
:param ctx: context associated with the parsed command
:starts_with: string that visible commands must start with.
:return: all visible (not hidden) commands that start with starts_with.

◆ is_incomplete_argument()

def click._bashcomplete.is_incomplete_argument (   current_params,
  cmd_param 
)
:param current_params: the current params and values for this
    argument as already entered
:param cmd_param: the current command parameter
:return: whether or not the last argument is incomplete and
    corresponds to this cmd_param. In other words whether or not the
    this cmd_param argument can still accept values

◆ is_incomplete_option()

def click._bashcomplete.is_incomplete_option (   all_args,
  cmd_param 
)
:param all_args: the full original list of args supplied
:param cmd_param: the current command paramter
:return: whether or not the last option declaration (i.e. starts
    "-" or "--") is incomplete and corresponds to this cmd_param. In
    other words whether this cmd_param option can still accept
    values

◆ resolve_ctx()

def click._bashcomplete.resolve_ctx (   cli,
  prog_name,
  args 
)
Parse into a hierarchy of contexts. Contexts are connected
through the parent variable.

:param cli: command definition
:param prog_name: the program that is running
:param args: full list of args
:return: the final context/command parsed

◆ start_of_option()

def click._bashcomplete.start_of_option (   param_str)
:param param_str: param_str to check
:return: whether or not this is the start of an option declaration
    (i.e. starts "-" or "--")

Variable Documentation

◆ COMPLETION_SCRIPT_BASH

string COMPLETION_SCRIPT_BASH
Initial value:
1 = """
2 %(complete_func)s() {
3  local IFS=$'\n'
4  COMPREPLY=( $( env COMP_WORDS="${COMP_WORDS[*]}" \\
5  COMP_CWORD=$COMP_CWORD \\
6  %(autocomplete_var)s=complete $1 ) )
7  return 0
8 }
9 
10 %(complete_func)setup() {
11  local COMPLETION_OPTIONS=""
12  local BASH_VERSION_ARR=(${BASH_VERSION//./ })
13  # Only BASH version 4.4 and later have the nosort option.
14  if [ ${BASH_VERSION_ARR[0]} -gt 4 ] || ([ ${BASH_VERSION_ARR[0]} -eq 4 ] \
15 && [ ${BASH_VERSION_ARR[1]} -ge 4 ]); then
16  COMPLETION_OPTIONS="-o nosort"
17  fi
18 
19  complete $COMPLETION_OPTIONS -F %(complete_func)s %(script_names)s
20 }
21 
22 %(complete_func)setup
23 """

◆ COMPLETION_SCRIPT_FISH

tuple COMPLETION_SCRIPT_FISH
Initial value:
1 = (
2  "complete --no-files --command %(script_names)s --arguments"
3  ' "(env %(autocomplete_var)s=complete_fish'
4  " COMP_WORDS=(commandline -cp) COMP_CWORD=(commandline -t)"
5  ' %(script_names)s)"'
6 )

◆ COMPLETION_SCRIPT_ZSH

string COMPLETION_SCRIPT_ZSH

◆ WORDBREAK

string WORDBREAK = "="