[Intel-gfx] [maintainer-tools PATCH 7/8] completion: use the dim helpers to complete subcommands and aliases

Jani Nikula jani.nikula at intel.com
Thu Feb 18 16:20:53 UTC 2016


Autodiscover everything, including user's configured aliases.

Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 bash_completion | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/bash_completion b/bash_completion
index f89764e3947d..4a9d981709a0 100644
--- a/bash_completion
+++ b/bash_completion
@@ -12,7 +12,6 @@ dim ()
 _dim ()
 {
 	local args arg cur prev words cword split
-	local cmds
 
 	# require bash-completion with _init_completion
 	type -t _init_completion >/dev/null 2>&1 || return
@@ -30,20 +29,6 @@ _dim ()
 	local nightly_branches="$(dim list-branches)"
 	local upstream_branches="$(dim list-upstreams)"
 
-	cmds="setup nightly-forget update-branches"
-	cmds="$cmds rebuild-nightly cat-to-fixup"
-	cmds="$cmds push-queued pq push-fixes pf push-next-fixes pnf push-branch"
-	cmds="$cmds checkout co conq cof conf"
-	cmds="$cmds apply-branch ab sob apply-queued aq apply-fixes af apply-next-fixes anf"
-	cmds="$cmds magic-patch mp cd"
-	cmds="$cmds magic-rebase-resolve mrr"
-	cmds="$cmds apply-igt ai"
-	cmds="$cmds apply-resolved ar tc fixes check-patch cp cherry-pick"
-	cmds="$cmds pull-request pull-request-fixes pull-request-next pull-request-next-fixes"
-	cmds="$cmds update-next"
-	cmds="$cmds create-branch remove-branch create-workdir for-each-workdirs fw"
-	cmds="$cmds tag-next checker"
-
 	if [ -z "${arg}" ]; then
 		# top level completion
 		case "${cur}" in
@@ -52,6 +37,7 @@ _dim ()
 				COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
 				;;
 			*)
+				local cmds="$(dim list-commands) $(dim list-aliases | sed 's/\t.*//')"
 				COMPREPLY=( $(compgen -W "${cmds}" -- ${cur}) )
 				;;
 		esac
-- 
2.1.4



More information about the Intel-gfx mailing list