]> rtime.felk.cvut.cz Git - novaboot.git/blobdiff - novaboot
Warn when multiple target connection options are given
[novaboot.git] / novaboot
index 23b853aecb1d0590f24dd7577b113ef391025582..c2e391ea61c8a5be0cc7c59566df8e7c563a192c 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -256,6 +256,16 @@ if ($ider) {
     if (!defined $amt) { die "Error: --ider requires --amt"; }
 }
 
+{
+    my %input_opts = ('--iprelay'    => \$iprelay,
+                     '--serial'     => \$serial,
+                     '--remote-cmd' => \$remote_cmd,
+                     '--amt'        => \$amt);
+    my @opts = grep(defined(${$input_opts{$_}}) , keys %input_opts);
+
+    print STDERR "novaboot: Warning: More than one target connection option: ".join(', ', @opts) if scalar @opts > 1;
+}
+
 # Default options
 if (defined $serial) {
     $serial ||= "/dev/ttyUSB0";