Source code for faust.cli.completion

import os
from pathlib import Path
import click_completion
from .base import AppCommand


[docs]class completion(AppCommand): """Output shell completion to be eval'd by the shell.""" require_app = False
[docs] async def run(self) -> None: self.say(click_completion.get_code(shell=self.shell()))
[docs] def shell(self) -> str: shell_path = Path(os.environ.get('SHELL', 'auto')) return shell_path.stem