Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add completion for fish shell #95

Open
line-o opened this issue Feb 23, 2023 · 0 comments
Open

Add completion for fish shell #95

line-o opened this issue Feb 23, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@line-o
Copy link
Member

line-o commented Feb 23, 2023

Enhancement

As a user of the fish shell I would like xst to provide completions not only for zsh and bash but for fish as well.

This will finally be possible when yargs/yargs#2281 is merged.

Alternatives

In the meantime you can already start with this script (ripped from the PR above)

Create a file ~/.config/fish/completions/xst.fish with following contents:

### xst completion - begin. generated by omelette.js ###
#
# yargs command completion script
#
#
function _xst_yargs_completion
  set cmd (commandline -b)
  for arg in (string split " " $cmd)
      set -a args "'$arg'"
  end
  set completions (eval xst --get-yargs-completions $args)
  for completion in $completions
    echo -e $completion
  end
end
complete -f -c xst -a '(_xst_yargs_completion)'
### xst completion - end ###
@line-o line-o added the enhancement New feature or request label Feb 23, 2023
@line-o line-o self-assigned this Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant