Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by George Sherwood (138951f8e062472840c2ea698e1bbba1fba4197e)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: George Sherwood <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by George Sherwood (138951f8e062472840c2ea698e1bbba1fba4197e)
  • Date: Fri, 29 Aug 2008 17:54:10 -0500

GIT changes to master grimoire by George Sherwood <gsherwood AT sourcemage.org>:

shell-term-fm/bash-completion/DETAILS | 2
shell-term-fm/bash-completion/HISTORY | 4 +
shell-term-fm/bash-completion/telinit_completion | 77
+++++++++++++++++++++++
3 files changed, 82 insertions(+), 1 deletion(-)

New commits:
commit 138951f8e062472840c2ea698e1bbba1fba4197e
Author: George Sherwood <gsherwood AT sourcemage.org>
Commit: George Sherwood <gsherwood AT sourcemage.org>

bash_completion: Added file for telinit completion.
Bug #14568

diff --git a/shell-term-fm/bash-completion/DETAILS
b/shell-term-fm/bash-completion/DETAILS
index 12fbdb6..81eeba0 100755
--- a/shell-term-fm/bash-completion/DETAILS
+++ b/shell-term-fm/bash-completion/DETAILS
@@ -6,7 +6,7 @@ SOURCE_DIRECTORY=$BUILD_DIRECTORY/bash_completion
SOURCE_URL[0]=http://www.caliban.org/files/bash/$SOURCE
WEB_SITE=http://www.caliban.org/bash/index.shtml#completion
ENTERED=20020215
- PATCHLEVEL=2
+ PATCHLEVEL=3
LICENSE[0]=GPL
KEYWORDS="bash console"
SHORT="bash programmable completion"
diff --git a/shell-term-fm/bash-completion/HISTORY
b/shell-term-fm/bash-completion/HISTORY
index b56b7b8..db85296 100644
--- a/shell-term-fm/bash-completion/HISTORY
+++ b/shell-term-fm/bash-completion/HISTORY
@@ -1,3 +1,7 @@
+2008-08-29 George Sherwood <gsherwood AT sourcemage.org>
+ * DETAILS: PATCHLEVEL++
+ * telinit_completion: Added file. Bug #14568
+
2008-08-22 George Sherwood <gsherwood AT sourcemage.org>
* DETAILS: PATCHLEVEL++
* smgl_completion: Added quill
diff --git a/shell-term-fm/bash-completion/telinit_completion
b/shell-term-fm/bash-completion/telinit_completion
new file mode 100644
index 0000000..968352d
--- /dev/null
+++ b/shell-term-fm/bash-completion/telinit_completion
@@ -0,0 +1,77 @@
+#!/bin/bash
+
+_run_script_list()
+{
+ COMPREPLY=( $( find /etc/init.d/runlevels -type f|xargs -n1
basename|grep -v runlevel.config|grep -E "^$cur" ) )
+}
+
+_runlevel_list ()
+{
+ COMPREPLY=( $( find /etc/init.d/runlevels -mindepth 1 -maxdepth 1
-type d \
+ |xargs -n1 basename| sed -n 's/^%//p' ) )
+}
+
+# Source Mage GNU/Linux utility functions used by actual completion functions
+# by Lunar_fr (lunar AT l-a-p.org)
+#
+_spell_list()
+{
+ for GRIMOIRE in `. $GRIMOIRE_LIST; echo ${GRIMOIRE_DIR[*]}`; do
+ COMPREPLY=( ${COMPREPLY[@]} $( cut -d' ' -f1 "$GRIMOIRE/codex.index"
| sed -ne 's/^\('$cur'.*\)/\1/p' ) )
+ done
+}
+
+# simpleinit_msb telinit completion
+# Based on
+#
+# Source Mage GNU/Linux scribe(8) completion
+# by Arjan Bouter (abouter AT sourcemage.org)
+#
+have telinit &&
+_telinit()
+{
+ local cur prev
+
+ COMPREPLY=()
+ cur=${COMP_WORDS[COMP_CWORD]}
+ first=${COMP_WORDS[1]}
+
+ if [ $COMP_CWORD = 1 ]; then
+ COMPREPLY=( $( compgen -W 'run switch enable disable bootenable \
+ bootdisable delete list runlevel runlevels move install
spellinstall' $cur ))
+ elif [ $COMP_CWORD = 2 ]; then
+ case "$first" in
+ @(run|enable|disable|bootenable|bootdisable|delete|move))
+ _run_script_list
+ return 0
+ ;;
+ switch)
+ _runlevel_list
+ return 0
+ ;;
+ spellinstall)
+ _spell_list
+ return 0
+ ;;
+ *)
+ return 0
+ ;;
+ esac
+ elif [ $COMP_CWORD = 3 ]; then
+ case "$first" in
+ run)
+ COMPREPLY=( $( compgen -W 'start stop restart reload
force-reload status' $cur ) )
+ return 0
+ ;;
+ @(install|move))
+ _runlevel_list
+ return 0
+ ;;
+ *)
+ return 0
+ ;;
+ esac
+ fi
+ return 0
+}
+[ "$have" ] && complete -F _telinit -o default telinit



  • [SM-Commit] GIT changes to master grimoire by George Sherwood (138951f8e062472840c2ea698e1bbba1fba4197e), George Sherwood, 08/29/2008

Archive powered by MHonArc 2.6.24.

Top of Page