freebsd-ports/shells/bash-completion/files/patch-portsnap
Adam Weinberger a7507f6544 Add completions for portsnap and freebsd-update. Both were obtained from upstream git.
Given the infrequency with which new versions of bash-completion are released, it
seems appropriate to just add them in here.

Submitted by:	Peter Dave Hello (author of the two completions)

While here, add in LICENSE.
2015-01-27 16:45:57 +00:00

52 lines
1.2 KiB
Bash

From c3770c17984bb61255db6adb48886b466c335e03 Mon Sep 17 00:00:00 2001
From: Peter Dave Hello <hsu@peterdavehello.org>
Date: Thu, 2 Jan 2014 03:28:56 +0800
Subject: portsnap: New completion.
diff --git completions/Makefile.am completions/Makefile.am
index be5bc26..7b8f767 100644
--- completions/Makefile.am
+++ completions/Makefile.am
@@ -261,6 +261,7 @@ bashcomp_DATA = 2to3 \
pm-is-supported \
pm-powersave \
portinstall \
+ portsnap \
portupgrade \
postcat \
postconf \
diff --git completions/portsnap completions/portsnap
new file mode 100644
index 0000000..22937c0
--- /dev/null
+++ completions/portsnap
@@ -0,0 +1,25 @@
+# bash completion for Portsnap -*- shell-script -*-
+
+[[ $OSTYPE == *freebsd* ]] || return 1
+
+_portsnap()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -d|-p)
+ _filedir -d
+ return
+ ;;
+ -l|-f)
+ _filedir
+ return
+ ;;
+ esac
+
+ COMPREPLY=( $(compgen -W "fetch cron extract update" -- $cur) )
+} &&
+complete -F _portsnap portsnap
+
+# ex: ts=4 sw=4 et filetype=sh
--
cgit v0.10.2