mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:39:52 +08:00
Use builtin command in spago completions, add to changelog
This commit is contained in:
parent
d544cda937
commit
863b4700f8
|
@ -225,6 +225,7 @@ Completions
|
|||
- ``rst2html``, ``rst2html4``, ``rst2html5``, ``rst2latex``,
|
||||
``rst2man``, ``rst2odt``, ``rst2pseudoxml``, ``rst2s5``,
|
||||
``rst2xetex``, ``rst2xml`` and ``rstpep2html`` (#7019)
|
||||
- ``spago`` (#7381)
|
||||
- ``sphinx-apidoc``, ``sphinx-autogen``, ``sphinx-build`` and
|
||||
``sphinx-quickstart`` (#7000)
|
||||
- ``strace`` (#6656)
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
# fish completion for spago, PureScript package manager and build tool
|
||||
# version v0.16.0
|
||||
|
||||
spago --fish-completion-script (which spago) | source
|
||||
spago --fish-completion-script (command -v spago) | source
|
||||
|
||||
function __fish_spago_is_arg_n --argument-names n
|
||||
test $n -eq (count (string match -v -- '-*' (commandline -poc)))
|
||||
end
|
||||
|
||||
function __fish_spago_pkgnames
|
||||
for line in (spago ls packages 2> /dev/null)
|
||||
set pkgname (echo $line | string match -r '[^\s]+')
|
||||
echo $pkgname
|
||||
end
|
||||
spago ls packages 2>/dev/null | string match -r '\S+'
|
||||
end
|
||||
|
||||
complete -c spago -n '__fish_seen_subcommand_from install; and __fish_spago_is_arg_n 2' -a '(__fish_spago_pkgnames)'
|
||||
|
|
Loading…
Reference in New Issue
Block a user