Skip to content

Add completion for fish shell #95

@line-o

Description

@line-o

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 ###

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions