From ed33156a25d218ced4efdc4aa1035e37c0e58629 Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Fri, 15 Feb 2013 09:33:31 +0100 Subject: [PATCH] added forall repo command Signed-off-by: Gaetan Semet --- plugins/repo/_repo | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/plugins/repo/_repo b/plugins/repo/_repo index 7226aaceb..bbfea7102 100644 --- a/plugins/repo/_repo +++ b/plugins/repo/_repo @@ -27,6 +27,7 @@ _repo() 'diff:Show changes between commit and working tree' 'download:Download and checkout a change' 'format-patch:build patch sets for each project common to a manifest baseline' + 'forall:execute command on several project' 'grep:Print lines matching a pattern' 'help:Display detailed help on a command' 'init:Initialize repo in the current directory' @@ -155,6 +156,15 @@ _repo() ': :__repo_projects' \ && ret=0 ;; + (forall) + _arguments : \ + "(-h --help)"{-h,--help}"[Show help]" \ + "(-v --verbose)"{-v,--verbose}"[Show command error messages]" \ + '(-p)-p[Show project headers before output]' \ + ': :__repo_projects_mandatory' \ + "(-c --command -h --help -v --verbose -p)"{-c,--command}"[Command (and arguments) to execute]" \ + && ret=0 + ;; *) ret=0 esac @@ -209,10 +219,17 @@ __repo_depth_prompt() __repo_projects() { _message -e depth 'Optional option : ...' - projects=("" $(repo list | cut -d' ' -f1)) + projects=($(repo list | cut -d' ' -f1)) _describe -t projects 'Select projects (keep empty for selecting all projects)' projects } +__repo_projects_mandatory() +{ + projects=($(repo list | cut -d' ' -f1)) + #_describe -t projects 'Select projects to apply commands' projects + _values -s ' ' "Select projects to apply commands" $projects +} + __repo_new__repo_branch_name() { branches=($(repo branches| cut -c4- | grep '|' | cut -d' ' -f1))