Patchwork [meta-fsl-arm,1/2] scripts/get-maintainers: support multiple machine directories on the command line

login
register
mail settings
Submitter Mario Domenech Goulart
Date April 25, 2014, 1:38 p.m.
Message ID <1398433137-22317-1-git-send-email-mario@ossystems.com.br>
Download mbox | patch
Permalink /patch/70959/
State Accepted
Delegated to: Otavio Salvador
Headers show

Comments

Mario Domenech Goulart - April 25, 2014, 1:38 p.m.
Now the optional machine specification must be indicated by the
--machine parameter, not to generate ambiguities with directories.

Signed-off-by: Mario Domenech Goulart <mario@ossystems.com.br>
---
 scripts/get-maintainer |   24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

Patch

diff --git a/scripts/get-maintainer b/scripts/get-maintainer
index d5a7907..1c5be02 100755
--- a/scripts/get-maintainer
+++ b/scripts/get-maintainer
@@ -21,21 +21,31 @@  usage() {
 	cat<<EOF
 Usage:
 
- $0 <path> [machine]
+ $0 [ --machine=<machine> ] <path> ...
 
- Options:
+   <path>
+       Directory(ies) where to look for machine definition files.
 
-   path: directory to look for machine definition files
-   machine: optinal param to restrict the printing for a specific machine name
+ Options:
 
+   --machine=<machine>
+      Optional param to restrict the printing for a specific machine name.
 
 EOF
 }
 
-path=$1
-specific_machine=$2
+path=
+specific_machine=
+
+for opt in ${*}; do
+    if [ "`echo $opt | cut -b-10`" = "--machine=" ]; then
+        specific_machine="`echo $opt | cut -b11-`"
+    else
+        path="$path $opt"
+    fi
+done
 
-if [ -z "$1" ]; then
+if [ -z "$path" ]; then
 	usage
 	return 1
 fi