]> Frank Brehm's Git Trees - config/berta/etc.git/commitdiff
committing changes in /etc after emerge run
authorFrank Brehm <frank@brehm-online.com>
Tue, 20 Dec 2016 13:23:19 +0000 (14:23 +0100)
committerFrank Brehm <frank@brehm-online.com>
Tue, 20 Dec 2016 13:23:19 +0000 (14:23 +0100)
Package changes:
+app-shells/gentoo-bashcomp-20140911

.etckeeper
bash_completion.d/gentoo-style-init [new file with mode: 0644]

index 65f543394b9e96ca6a46dc5eab82393dbedadc0d..3139a8b2b571b5135246dbeab685ab805e148656 100755 (executable)
@@ -1,6 +1,5 @@
 # Generated by etckeeper.  Do not edit.
 
-mkdir -p './bash_completion.d'
 mkdir -p './ca-certificates/update.d'
 mkdir -p './kernel/install.d'
 mkdir -p './security/limits.d'
@@ -27,6 +26,7 @@ maybe chmod 0755 'bash/bashrc.d'
 maybe chmod 0644 'bash/bashrc.d/.keep_app-shells_bash-0'
 maybe chmod 0644 'bash/bashrc.d/fbrehm.sh'
 maybe chmod 0755 'bash_completion.d'
+maybe chmod 0644 'bash_completion.d/gentoo-style-init'
 maybe chmod 0755 'binfmt.d'
 maybe chmod 0644 'binfmt.d/.keep_sys-apps_systemd-0'
 maybe chmod 0755 'byobu'
diff --git a/bash_completion.d/gentoo-style-init b/bash_completion.d/gentoo-style-init
new file mode 100644 (file)
index 0000000..8545692
--- /dev/null
@@ -0,0 +1,27 @@
+# Gentoo init.d completion
+#
+# $Id$
+#
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+_gentoo_style_init()
+{
+    local script="${COMP_WORDS[0]}"
+    local cur="${COMP_WORDS[$COMP_CWORD]}"
+
+    if [[ ( -f "${script}" || -h "${script}" ) && -r "${script}" ]] \
+    && [[ "${script}" != *.sh ]] \
+    && [[ "$(head -n 1 "${script}")" = "#!/sbin/runscript" ]]
+    then
+    [[ $COMP_CWORD -gt 1 ]] && return 1
+    COMPREPLY=($(opts="start stop status restart pause zap ineed needsme iuse usesme broken"; \
+            eval "$(grep '^opts=' "${script}")"; echo "${opts}"))
+    [[ -n "$COMPREPLY" ]] || COMPREPLY=(start stop restart zap)
+    COMPREPLY=($(compgen -W "${COMPREPLY[*]}" -- "${cur}"))
+    else
+    COMPREPLY=($(compgen -o default -- "${cur}"))
+    fi
+    return 0
+}
+complete -F _gentoo_style_init /etc/init.d/*