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: Format a completion item into the form recognized by the
  shell script. This must be implemented by subclasses.
  
  :param item: Completion item to format.
docstr_tok: ["Format","a","completion","item","into","the","form","recognized","by","the","shell","script",".","This","must","be","implemented","by","subclasses",".",":","param","item",":","Completion","item","to","format","."]
code: def format_completion(self, item: CompletionItem) -> str:
      """Format a completion item into the form recognized by the
      shell script. This must be implemented by subclasses.
  
      :param item: Completion item to format.
      """
      raise NotImplementedError
  
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 7 for calling the ShellComplete obj's underlying member method code with example usage: obj.format_completion(item) without return types