]> xenbits.xensource.com Git - osstest.git/commitdiff
cr-publish-flight-logs: Make a proper option parser
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 10 Aug 2020 10:27:11 +0000 (11:27 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Mon, 10 Aug 2020 10:51:32 +0000 (11:51 +0100)
I was going to add another option but changed my mind.  But, let's
keep this patch anyway.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
cr-publish-flight-logs

index faae7e0ebf3980380b562784e0b33cd368510db2..717cb957aac566b6706ae1d3bafeaa80a293197a 100755 (executable)
@@ -28,9 +28,14 @@ our %c;
 readglobalconfig();
 
 my $push_harness = 0;
-if (@ARGV && $ARGV[0] =~ m{^--push-harness(?:-try)?$}) {
-    $push_harness = $&;
-    shift @ARGV;
+while (@ARGV && $ARGV[0] =~ m{^-}) {
+    $_ = shift @ARGV;
+    last if $_ eq '--';
+    if (m{^--push-harness(?:-try)?$}) {
+       $push_harness = $&;
+    } else {
+       die "unknown option \`$_' ?";
+    }
 }
 
 my $flight= shift @ARGV // '';