Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
CompletionCommand Class Reference
Inheritance diagram for CompletionCommand:
Collaboration diagram for CompletionCommand:

Public Member Functions

None add_options (self)
 
int run (self, Values options, List[str] args)
 
- Public Member Functions inherited from Command
None __init__ (self, str name, str summary, bool isolated=False)
 
None handle_pip_version_check (self, Values options)
 
Tuple[Values, List[str]] parse_args (self, List[str] args)
 
int main (self, List[str] args)
 
- Public Member Functions inherited from CommandContextMixIn
Generator[None, None, Nonemain_context (self)
 
_T enter_context (self, ContextManager[_T] context_provider)
 

Data Fields

 cmd_opts
 
- Data Fields inherited from Command
 name
 
 summary
 
 parser
 
 cmd_opts
 
 tempdir_registry
 
 verbosity
 

Static Public Attributes

bool ignore_require_venv = True
 
- Static Public Attributes inherited from Command
str usage = ""
 
bool ignore_require_venv = False
 

Additional Inherited Members

- Protected Member Functions inherited from Command
int _main (self, List[str] args)
 
- Protected Attributes inherited from CommandContextMixIn
 _in_main_context
 
 _main_context
 

Detailed Description

A helper command to be used for command completion.

Definition at line 66 of file completion.py.

Member Function Documentation

◆ add_options()

None add_options (   self)

Reimplemented from Command.

Definition at line 71 of file completion.py.

71 def add_options(self) -> None:
72 self.cmd_opts.add_option(
73 "--bash",
74 "-b",
75 action="store_const",
76 const="bash",
77 dest="shell",
78 help="Emit completion code for bash",
79 )
80 self.cmd_opts.add_option(
81 "--zsh",
82 "-z",
83 action="store_const",
84 const="zsh",
85 dest="shell",
86 help="Emit completion code for zsh",
87 )
88 self.cmd_opts.add_option(
89 "--fish",
90 "-f",
91 action="store_const",
92 const="fish",
93 dest="shell",
94 help="Emit completion code for fish",
95 )
96 self.cmd_opts.add_option(
97 "--powershell",
98 "-p",
99 action="store_const",
100 const="powershell",
101 dest="shell",
102 help="Emit completion code for powershell",
103 )
104
105 self.parser.insert_option_group(0, self.cmd_opts)
106
for i

References Command.cmd_opts, CacheCommand.cmd_opts, CompletionCommand.cmd_opts, ConfigurationCommand.cmd_opts, DebugCommand.cmd_opts, DownloadCommand.cmd_opts, FreezeCommand.cmd_opts, HashCommand.cmd_opts, IndexCommand.cmd_opts, InspectCommand.cmd_opts, InstallCommand.cmd_opts, ListCommand.cmd_opts, SearchCommand.cmd_opts, ShowCommand.cmd_opts, UninstallCommand.cmd_opts, WheelCommand.cmd_opts, and i.

◆ run()

int run (   self,
Values  options,
List[str]  args 
)
Prints the completion code of the given shell

Reimplemented from Command.

Definition at line 107 of file completion.py.

107 def run(self, options: Values, args: List[str]) -> int:
108 """Prints the completion code of the given shell"""
109 shells = COMPLETION_SCRIPTS.keys()
110 shell_options = ["--" + shell for shell in sorted(shells)]
111 if options.shell in shells:
112 script = textwrap.dedent(
113 COMPLETION_SCRIPTS.get(options.shell, "").format(prog=get_prog())
114 )
115 print(BASE_COMPLETION.format(script=script, shell=options.shell))
116 return SUCCESS
117 else:
119 "ERROR: You must pass {}\n".format(" or ".join(shell_options))
120 )
121 return SUCCESS

References i.

Field Documentation

◆ cmd_opts

◆ ignore_require_venv

bool ignore_require_venv = True
static

Definition at line 69 of file completion.py.


The documentation for this class was generated from the following file: