[Bash-completion-commits] ./current r1325: Added quota-tools completion

David Paleino d.paleino at gmail.com
Thu Feb 5 09:53:04 UTC 2009


------------------------------------------------------------
revno: 1325
committer: David Paleino <d.paleino at gmail.com>
branch nick: current
timestamp: Thu 2009-02-05 10:53:04 +0100
message:
  Added quota-tools completion
renamed:
  to_review/quota-tools => contrib/quota-tools
modified:
  debian/changelog
  contrib/quota-tools
-------------- next part --------------
=== renamed file 'to_review/quota-tools' => 'contrib/quota-tools'
--- a/to_review/quota-tools	2009-01-19 21:11:47 +0000
+++ b/contrib/quota-tools	2009-02-05 09:53:04 +0000
@@ -27,11 +27,12 @@
 
 _filesystems()
 {
-	COMPREPLY=( $( compgen -W '$(awk '!/^none/ {print $1}' /etc/mtab)' \
+	#  Only list filesystems starting with "/", otherwise we also get
+	#+ "binfmt_misc", "proc", "tmpfs", ...
+	COMPREPLY=( $( compgen -W "$(awk '/^\// {print $1}' /etc/mtab)" \
 		-- $cur ) )
 }
 
-
 _quota()
 {
 	local cur prev
@@ -46,14 +47,28 @@
 			return 0
 			;;
 	esac
+	
+	if [[ "$cur" == *=* ]]; then
+		prev=${cur/=*/}
+		cur=${cur/*=/}
+		case $prev in
+			--format)
+				_quota_formats
+				return 0
+				;;
+		esac
+	fi
 
 	if [[ "$cur" == -* ]]; then
-		COMPREPLY=( $( compgen -W '-F -g -u -v -s -i -l -q -Q' -- $cur ) )
+		COMPREPLY=( $( compgen -W '-F --format= -g --group -u --user -v --verbose \
+			-s --human-readable -p --raw-grace -i --no-autofs -l --local-only \
+			-A --all-nfs -m --no-mixed-pathnames -q --quiet -Q --quiet-refuse \
+			-w --no-wrap' -- $cur ) )
 	else
 		_user_or_group
 	fi
 }
-complete -F _quota quota
+complete -F _quota $default quota
 
 _setquota()
 {
@@ -70,8 +85,21 @@
 			;;
 	esac
 
+	if [[ "$cur" == *=* ]]; then
+		prev=${cur/=*/}
+		cur=${cur/*=/}
+		case $prev in
+			--format)
+				_quota_formats
+				return 0
+				;;
+		esac
+	fi
+
 	if [[ "$cur" == -* ]]; then
-		COMPREPLY=( $( compgen -W '-r -F -g -u -p -b -t -T -a' -- $cur ) )
+		COMPREPLY=( $( compgen -W '-r --remote -m --no-mixed-pathnames \
+			-F --format= -g --group -u --user -p --prototype= -b --batch \
+			-c --continue-batch -t --edit-period -T --edit-times -a --all' -- $cur ) )
 	else
 		_count_args
 
@@ -86,7 +114,7 @@
 
 	fi
 }
-complete -F _setquota setquota
+complete -F _setquota $default setquota
 
 _edquota()
 {
@@ -101,19 +129,32 @@
 			_quota_formats
 			return 0
 			;;
-		-f)
+		-@(f|-filesystem))
 			_filesystems
 			return 0
 			;;
 	esac
 
+	if [[ "$cur" == *=* ]]; then
+		prev=${cur/=*/}
+		cur=${cur/*=/}
+		case $prev in
+			--format)
+				_quota_formats
+				return 0
+				;;
+		esac
+	fi
+
 	if [[ "$cur" == -* ]]; then
-		COMPREPLY=( $( compgen -W '-r -g -u -p -F -f -t -T' -- $cur ) )
+		COMPREPLY=( $( compgen -W '-r --remote -m --no-mixed-pathnames \
+			-g --group -u --user -p --prototype= -F --format= -f --filesystem \
+			-t --edit-period -T --edit-times' -- $cur ) )
 	else
 		_user_or_group
 	fi
 }
-complete -F _edquota edquota
+complete -F _edquota $default edquota
 
 _quotacheck()
 {
@@ -130,14 +171,28 @@
 			;;
 	esac
 
+	if [[ "$cur" == *=* ]]; then
+		prev=${cur/=*/}
+		cur=${cur/*=/}
+		case $prev in
+			--format)
+				_quota_formats
+				return 0
+				;;
+		esac
+	fi
+
 	if [[ "$cur" == -* ]]; then
-		COMPREPLY=( $( compgen -W '-g -u -b -c -f -i -n -v -d -M -m -R \
-			-F -a' -- $cur ) )
+		COMPREPLY=( $( compgen -W '-b --backup -v --verbose -d --debug \
+			-g --group -u --user -c --create-files -f --force -i \
+			--interactive -n --use-first-dquot -M --try-remount -m \
+			--no-remount -R --exclude-root -F --format= -a --all' \
+			-- $cur ) )
 	else
 		_filesystems
 	fi
 }
-complete -F _quotacheck quotacheck
+complete -F _quotacheck $default quotacheck
 
 _repquota()
 {
@@ -154,14 +209,27 @@
 			;;
 	esac
 
+	if [[ "$cur" == *=* ]]; then
+		prev=${cur/=*/}
+		cur=${cur/*=/}
+		case $prev in
+			--format)
+				_quota_formats
+				return 0
+				;;
+		esac
+	fi
+
 	if [[ "$cur" == -* ]]; then
-		COMPREPLY=( $( compgen -W '-v -s -i -u -g -c -C -t -n -F' -- \
-			$cur ) )
+		COMPREPLY=( $( compgen -W '-a --all -v --verbose -s --human-readable \
+			-c --batch-translation -C --no-batch-translation -t \
+			--truncate-names -n --no-names -p --raw-grace -i --no-autofs \
+			-u --user -g --group -F --format=' -- $cur ) )
 	else
 		_filesystems
 	fi
 }
-complete -F _repquota repquota
+complete -F _repquota $default repquota
 
 _quotaon()
 {
@@ -171,6 +239,7 @@
 	cur=`_get_cword`
 	prev=${COMP_WORDS[COMP_CWORD-1]}
 
+	echo --$cmd--
 	case $prev in
 		-F)
 			_quota_formats
@@ -178,13 +247,25 @@
 			;;
 	esac
 
+	if [[ "$cur" == *=* ]]; then
+		prev=${cur/=*/}
+		cur=${cur/*=/}
+		case $prev in
+			--format)
+				_quota_formats
+				return 0
+				;;
+		esac
+	fi
+
 	if [[ "$cur" == -* ]]; then
-		COMPREPLY=( $( compgen -W '-a -v -u -g -f -p -F' -- $cur ) )
+		COMPREPLY=( $( compgen -W '-a --all -v --verbose -u --user \
+			-g --group -f --off -p --print-state -F --format=' -- $cur ) )
 	else
 		_filesystems
 	fi
 }
-complete -F _quotaon quotaon
+complete -F _quotaon $default quotaon
 
 _quotaoff()
 {
@@ -199,13 +280,30 @@
 			_quota_formats
 			return 0
 			;;
+		-@(x|-xfs-command))
+			COMPREPLY=( $( compgen -W 'delete enforce' -- $cur ) )
+			return 0
+			;;
 	esac
 
+	if [[ "$cur" == *=* ]]; then
+		prev=${cur/=*/}
+		cur=${cur/*=/}
+		case $prev in
+			--format)
+				_quota_formats
+				return 0
+				;;
+		esac
+	fi
+
 	if [[ "$cur" == -* ]]; then
-		COMPREPLY=( $( compgen -W '-a -v -u -g -p -x' -- $cur ) )
+		COMPREPLY=( $( compgen -W '-a --all -v --verbose -u --user \
+			-g --group -p --print-state -x --xfs-command -F --format=' \
+			-- $cur ) )
 	else
 		_filesystems
 	fi
 }
-complete -F _quotaoff quotaoff
+complete -F _quotaoff $default quotaoff
 }

=== modified file 'debian/changelog'
--- a/debian/changelog	2009-02-05 09:04:37 +0000
+++ b/debian/changelog	2009-02-05 09:53:04 +0000
@@ -9,6 +9,7 @@
   * Added qemu completion
   * Added net-tools (mii-tool and mii-diag) completions
   * Added minicom completion
+  * Added quota-tools completion
 
   [ David Paleino ]
   * Added .kar to Timidity completion.
@@ -128,7 +129,7 @@
   * Prevent completion dir from being sourced twice if
     BASH_COMPLETION_DIR and BASH_COMPLETION_COMPAT_DIR are equal (Alioth#311433) 
 
- -- David Paleino <d.paleino at gmail.com>  Thu, 05 Feb 2009 10:04:16 +0100
+ -- David Paleino <d.paleino at gmail.com>  Thu, 05 Feb 2009 10:52:42 +0100
 
 bash-completion (20080705) unstable; urgency=low
 



More information about the Bash-completion-commits mailing list