[ELDK] [DUTS] [PATCH] Add "-y" option: assume "yes" input and auto-start execution

Wolfgang Denk wd at denx.de
Sun Oct 30 16:38:57 CET 2011


Signed-off-by: Wolfgang Denk <wd at denx.de>
cc: Detlev Zundel <dzu at denx.de>
---
 duts            |    6 ++++++
 include/lib.tcl |    6 ++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/duts b/duts
index ad36452..5fa49a9 100755
--- a/duts
+++ b/duts
@@ -43,6 +43,7 @@ proc usage {optlist} {
 }
 
 set verbose "no"
+set assume_yes "no"
 set debugging "yes"
 
 ##
@@ -179,6 +180,7 @@ set options {
 	{var.arg	""	"override supplied variables, ? lists defined vars"}
 	{continue		"continue previously interrupted run"}
 	{n			"dry-run"}
+	{y			"auto-confirm start of execution"}
 	{showtc			"show details about selected testcases"}
 	{showconfig		"show details about selected configuration"}
 	{v                      "be verbose"}
@@ -209,6 +211,10 @@ if {$params(v)} {
 	set verbose "yes"
 	p_verb "verbose mode ON"
 }
+if {$params(y)} {
+	set assume_yes "yes"
+	p_verb "assume yes mode ON"
+}
 
 set board_name [lindex $argv 0]
 # Board name of '?' lists available boards
diff --git a/include/lib.tcl b/include/lib.tcl
index f8b2ea7..b999881 100644
--- a/include/lib.tcl
+++ b/include/lib.tcl
@@ -260,6 +260,12 @@ proc p_banner {msg {p "* "}} {
 #
 proc ask_yesno {msg} {
 
+	global assume_yes
+
+	if {$assume_yes == "yes"} {
+		return 1
+	}
+
 	set timeout -1
 	send_user "$msg\[y] "
 	expect_user -re "(.*)\n" {
-- 
1.7.6.4



More information about the eldk mailing list