class_docstr: Base class for providing shell completion support. A subclass for
  a given shell will override attributes and methods to implement the
  completion instructions (``source`` and ``complete``).
  
  :param cli: Command being called.
  :param prog_name: Name of the executable in the shell.
  :param complete_var: Name of the environment variable that holds
      the completion instruction.
  
  .. versionadded:: 8.0
class_docstr_tok: ["Base","class","for","providing","shell","completion","support",".","A","subclass","for","a","given","shell","will","override","attributes","and","methods","to","implement","the","completion","instructions","(","``","source","``","and","``","complete","``",")",".",":","param","cli",":","Command","being","called",".",":","param","prog_name",":","Name","of","the","executable","in","the","shell",".",":","param","complete_var",":","Name","of","the","environment","variable","that","holds","the","completion","instruction",".","..","versionadded",":",":","8.0"]
docstr: Produce the completion data to send back to the shell.
  
  By default this calls :meth:`get_completion_args`, gets the
  completions, then calls :meth:`format_completion` for each
  completion.
docstr_tok: ["Produce","the","completion","data","to","send","back","to","the","shell",".","By","default","this","calls",":","meth",":","`","get_completion_args","`",",","gets","the","completions",",","then","calls",":","meth",":","`","format_completion","`","for","each","completion","."]
code: def complete(self) -> str:
      """Produce the completion data to send back to the shell.
  
      By default this calls :meth:`get_completion_args`, gets the
      completions, then calls :meth:`format_completion` for each
      completion.
      """
      args, incomplete = self.get_completion_args()
      completions = self.get_completions(args, incomplete)
      out = [self.format_completion(item) for item in completions]
      return "\n".join(out)
  
imports: import os
  import re
  import typing
  from gettext import gettext
  from .core import Argument
  from .core import BaseCommand
  from .core import Context
  from .core import MultiCommand
  from .core import Option
  from .core import Parameter
  from .core import ParameterSource
  from .parser import split_arg_string
  from .utils import echo
label_desc: Use image node_id 8 for calling the ShellComplete obj's underlying member method code with example usage: obj.complete() and returns: str