Skip to content

Request: Provide shell-completions to stdout for a given shell #140

@kseistrup

Description

@kseistrup

Hey,

When Leaf is installed system-wide, it would make more sense to also have the shell completions installed system-wide, rather than asking each user to individually install the completions for their shell.

Currently, as a packager, I can:

  for _shell in bash fish zsh; do
    env SHELL=$_shell HOME=$TMPDIR --auto-complete
  done

and I would then have to find the completions as

  $TMPDIR/.local/share/leaf/completions/leaf.bash
  $TMPDIR/.config/fish/completions/leaf.fish`
  $TMPDIR/.local/share/leaf/completions/_leaf
  # Ignore $TMPDIR/.bashrc and $TMPDIR/.zshrc

and install them in the package.

With the proposed change/addition, packagers could

  for _shell in bash fish zsh; do
    leaf --generate-completions "$_shell" > "_completions.$_shell"
  done

and have the completions available as

  _completions.bash
  _completions.fish
  _completions.zsh
  # And _no_ RC files

from where they can [more] easily be packaged, and they would be immediately available to all users.

Cheers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions