[Lunar-commits] r16541 - in moonbase/trunk/graphics/scrot: . profile.d

Chad Kittel v3rt1g0 at lunar-linux.org
Sun Sep 18 17:04:50 UTC 2005


Author: v3rt1g0
Date: 2005-09-18 17:04:50 +0000 (Sun, 18 Sep 2005)
New Revision: 16541

Added:
   moonbase/trunk/graphics/scrot/profile.d/
   moonbase/trunk/graphics/scrot/profile.d/scrot.rc
Log:
Added a bash completion script for scrot.  Now i dont' have to remember 
those pesky options!


Added: moonbase/trunk/graphics/scrot/profile.d/scrot.rc
===================================================================
--- moonbase/trunk/graphics/scrot/profile.d/scrot.rc	2005-09-18 17:01:06 UTC (rev 16540)
+++ moonbase/trunk/graphics/scrot/profile.d/scrot.rc	2005-09-18 17:04:50 UTC (rev 16541)
@@ -0,0 +1,37 @@
+_scrot() {
+	local cur prev opts
+	COMPREPLY=()
+	cur=${COMP_WORDS[COMP_CWORD]}
+	prev=${COMP_WORDS[COMP_CWORD-1]}
+	opts="-h --help -v --version -b --border -c --count -d --delay -e --exec \
+	-q --quality -m --multidisp -s --select -t --thumb" 
+
+	if [[ "${cur}" == -* ]] || [[ ${COMP_CWORD} -eq 1 ]]; then
+    	COMPREPLY=($(compgen -W "${opts}" -- "${cur}"))
+	fi
+
+	case "${prev}" in
+		-e|--exec)
+			COMPREPLY=($(compgen -A command -- "${cur}"))
+			;;
+		-h|--help)
+			COMPREPLY=($(compgen -W "${opts/-h --help}" -- "${cur}"))
+			;;
+		-v|--version)
+			COMPREPLY=($(compgen -W "${opts/-v --version}" -- "${cur}"))
+			;;
+		-b|--border)
+			COMPREPLY=($(compgen -W "${opts/-b --border}" -- "${cur}"))
+			;;
+		-c|--count)
+			COMPREPLY=($(compgen -W "${opts/-c --count}" -- "${cur}"))
+			;;
+		-m|--multidisp)
+			COMPREPLY=($(compgen -W "${opts/-m --multidisp}" -- "${cur}"))
+			;;
+		-s|--select)
+			COMPREPLY=($(compgen -W "${opts/-s --select}" -- "${cur}"))
+			;;
+	esac		
+}
+complete -F _scrot scrot



More information about the Lunar-commits mailing list