Skip to content

Commit

Permalink
Use builtin command in spago completions, add to changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
krobelus committed Oct 10, 2020
1 parent d544cda commit 863b470
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Expand Up @@ -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)
Expand Down
7 changes: 2 additions & 5 deletions share/completions/spago.fish
@@ -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)'

0 comments on commit 863b470

Please sign in to comment.