craft_cli.completion package

Submodules

Module contents

Bash completion script generation module.

craft_cli.completion.complete(shell_cmd: str, get_app_info: Callable[[], Tuple[Dispatcher, Dict[str, Any] | None]]) str[source]

Generate a bash completion script based on a craft-cli dispatcher.

Parameters:
  • shell_cmd – The name of the command being completed for

  • get_app_info – A function that returns a populated craft-cli dispatcher and the config

needed to create its commands :return: A bash completion script for shell_cmd