install completion files for bash and zsh

This commit is contained in:
jasper 2018-07-09 06:34:25 +00:00
parent 577a26fae5
commit f8db7120f9
4 changed files with 10378 additions and 2 deletions

View File

@ -1,9 +1,10 @@
# $OpenBSD: Makefile,v 1.1.1.1 2018/07/08 11:25:23 jasper Exp $
# $OpenBSD: Makefile,v 1.2 2018/07/09 06:34:25 jasper Exp $
COMMENT = rsync for cloud storage
V = 1.42
DISTNAME = rclone-v${V}
PKGNAME = rclone-${V}
REVISION = 0
CATEGORIES = sysutils
@ -26,5 +27,17 @@ ALL_TARGET = github.com/ncw/rclone
do-install:
${INSTALL_PROGRAM} ${MODGO_WORKSPACE}/bin/rclone ${PREFIX}/bin/
${INSTALL_MAN} ${WRKSRC}/rclone.1 ${PREFIX}/man/man1
${INSTALL_DATA_DIR} ${PREFIX}/share/bash-completion/completions/ \
${PREFIX}/share/zsh/vendor-completions/
${INSTALL_DATA} ${FILESDIR}/rclone.bash \
${PREFIX}/share/bash-completion/completions/rclone
${INSTALL_DATA} ${FILESDIR}/rclone.zsh \
${PREFIX}/share/zsh/vendor-completions/_rclone
# maintainer target to generate completion files
completions:
.for s in bash zsh
${LOCALBASE}/bin/rclone genautocomplete $s ${FILESDIR}/rclone.$s
.endfor
.include <bsd.port.mk>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,37 @@
#compdef rclone
_arguments \
'1: :->level1' \
'2: :->level2' \
'3: :_files'
case $state in
level1)
case $words[1] in
rclone)
_arguments '1: :(about authorize cachestats cat check cleanup config copy copyto cryptcheck cryptdecode dbhashsum dedupe delete deletefile genautocomplete gendocs hashsum help info link listremotes ls lsd lsf lsjson lsl md5sum memtest mkdir move moveto ncdu obscure purge rc rcat rmdir rmdirs serve sha1sum size sync touch tree version)'
;;
*)
_arguments '*: :_files'
;;
esac
;;
level2)
case $words[2] in
config)
_arguments '2: :(create delete dump edit file password providers show update)'
;;
genautocomplete)
_arguments '2: :(bash zsh)'
;;
serve)
_arguments '2: :(http restic webdav)'
;;
*)
_arguments '*: :_files'
;;
esac
;;
*)
_arguments '*: :_files'
;;
esac

View File

@ -1,3 +1,9 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2018/07/08 11:25:23 jasper Exp $
@comment $OpenBSD: PLIST,v 1.2 2018/07/09 06:34:25 jasper Exp $
@bin bin/rclone
@man man/man1/rclone.1
share/bash-completion/
share/bash-completion/completions/
share/bash-completion/completions/rclone
share/zsh/
share/zsh/vendor-completions/
share/zsh/vendor-completions/_rclone