Skip to content

Commit 357f94c

Browse files
committed
Merge pull request eli-schwartz#20
2 parents f88c7ae + 2bfb8ee commit 357f94c

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ HOOKSDIR ?= $(PREFIX)/share/aurpublish
44
ZCOMPDIR ?= $(PREFIX)/share/zsh/site-functions
55
MANS = doc/aurpublish.1
66
BASHCOMPDIR ?= $(shell pkg-config bash-completion --variable=completionsdir || echo '/usr/share/bash-completion/completions')
7+
FISHCOMPDIR ?= $(PREFIX)/share/fish/vendor_completions.d
78

89
edit = sed -e 's|@HOOKSDIR@|$(HOOKSDIR)|g'
910

@@ -26,8 +27,10 @@ install: all
2627
install -m755 *.hook '$(DESTDIR)$(HOOKSDIR)/'
2728
install -dm755 '$(DESTDIR)$(ZCOMPDIR)'
2829
install -dm755 '$(DESTDIR)$(BASHCOMPDIR)'
30+
install -dm755 '$(DESTDIR)$(FISHCOMPDIR)'
2931
install -m644 completion/$(NAME).zsh '$(DESTDIR)$(ZCOMPDIR)/_$(NAME)'
3032
install -m644 completion/$(NAME).bash '$(DESTDIR)$(BASHCOMPDIR)/$(NAME)'
33+
install -m644 completion/$(NAME).fish '$(DESTDIR)$(FISHCOMPDIR)/$(NAME).fish'
3134
for manfile in $(MANS); do \
3235
install -Dm644 $$manfile -t $(DESTDIR)$(PREFIX)/share/man/man$${manfile##*.}; \
3336
done

completion/aurpublish.fish

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# aurpublish
2+
3+
set -l local_pkgs "(git ls-tree -d --name-only HEAD :/ 2>/dev/null)"
4+
5+
set -l all_pkgs
6+
# Try to get a pkg list from AUR helpers, otherwise ask pacman for foreign packages
7+
if type -q 'yay'
8+
set all_pkgs "(yay -Pc)"
9+
else if type -q 'paru'
10+
set all_pkgs "(paru -Pc | string replace ' ' \t)"
11+
else
12+
set all_pkgs "(pacman -Qqm)"
13+
end
14+
15+
set -l subcmds setup log
16+
complete -c aurpublish -n "not __fish_seen_subcommand_from $subcmds" -xa $local_pkgs -d 'Push a subtree to the AUR'
17+
complete -c aurpublish -n "not __fish_seen_subcommand_from $subcmds" -a setup \
18+
-d 'Install githooks to the repository'
19+
complete -c aurpublish -n "__fish_seen_subcommand_from setup" -x
20+
complete -c aurpublish -n "not __fish_seen_subcommand_from $subcmds" -a log \
21+
-d 'Wrapper for `git log`, substituting a package subtree for the revision/branch.'
22+
complete -c aurpublish -n "__fish_seen_subcommand_from log" -xa $local_pkgs
23+
24+
complete -c aurpublish -s p -ra $all_pkgs -d 'Instead of publishing, pull changes from the AUR'
25+
complete -c aurpublish -s s -l speedup -d 'Speedup future publishing by recording the subtree history during a push'
26+
complete -c aurpublish -s h -l help -d 'Prints a usage page'
27+

0 commit comments

Comments
 (0)