Fish completion scripts (Effect's internal completions/fish): one
complete line per subcommand, flag and typed argument, scoped by the
subcommand path.
Functions#
generate#
generate(executable, descriptor) -> str| Parameter | Type | Description |
|---|---|---|
executable | str | |
descriptor | CommandDescriptor |
Returns str
def generate(executable: str, descriptor: CommandDescriptor) -> str:
lines = [
f"###-begin-{executable}-completions-###",
"#",
"# Static completion script for Fish",
"#",
"# Installation:",
f"# {executable} --completions fish > ~/.config/fish/completions/{executable}.fish",
"#",
"",
]
_completions(executable, descriptor, [], lines)
lines.append("")
lines.append(f"###-end-{executable}-completions-###")
return "\n".join(lines)