Skip to content

Commit

Permalink
tools: punchboot: Add shell completion help command
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasblixt committed Dec 4, 2023
1 parent a757009 commit 78f4500
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tools/punchboot/punchboot/__main__.py
Expand Up @@ -631,5 +631,27 @@ def slc_revoke_key(ctx: click.Context, s: Session, key_id: str, force: bool):
s.slc_revoke_key(_key_id)


@cli.command("completion")
@click.pass_context
def shell_completion_helper(ctx: click.Context):
"""Shell completion helpers."""
_help_text = """
Punchboot supports shell completions for bash, zsh and fish.
Put one of the following lines in the appropriate .rc -file to enable
shell completions.
bash:
eval "$(_PUNCHBOOT_COMPLETE=bash_source punchboot)"
zsh:
eval "$(_PUNCHBOOT_COMPLETE=zsh_source punchboot)"
fish:
_PUNCHBOOT_COMPLETE=fish_source punchboot | source
"""

click.echo(_help_text)


if __name__ == "__main__":
cli()

0 comments on commit 78f4500

Please sign in to comment.