[dpdk-dev] tools: exit setup script without prompt

Message ID 1445510187-2954-1-git-send-email-john.mcnamara@intel.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

John McNamara Oct. 22, 2015, 10:36 a.m. UTC
  Exit tools/setup.sh script without prompting "Press enter to continue".

The script can now be exited by typing the option number, "quit" or "q".

Signed-off-by: John McNamara <john.mcnamara@intel.com>
---
 tools/setup.sh | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
  

Comments

Van Haaren, Harry Oct. 23, 2015, 4:07 p.m. UTC | #1
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of John McNamara
> Sent: Thursday, October 22, 2015 11:36 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] tools: exit setup script without prompt
> 
> Exit tools/setup.sh script without prompting "Press enter to continue".
> 
> The script can now be exited by typing the option number, "quit" or "q".
> 
> Signed-off-by: John McNamara <john.mcnamara@intel.com>

Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
  
Thomas Monjalon Dec. 3, 2015, 7:31 p.m. UTC | #2
> > Exit tools/setup.sh script without prompting "Press enter to continue".
> > 
> > The script can now be exited by typing the option number, "quit" or "q".
> > 
> > Signed-off-by: John McNamara <john.mcnamara@intel.com>
> 
> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>

Applied, thanks
  

Patch

diff --git a/tools/setup.sh b/tools/setup.sh
index 5a8b2f3..fbd3853 100755
--- a/tools/setup.sh
+++ b/tools/setup.sh
@@ -57,6 +57,12 @@  quit()
 	QUIT=$1
 }
 
+# Shortcut for quit.
+q()
+{
+	quit
+}
+
 #
 # Sets up environmental variables for ICC.
 #
@@ -628,6 +634,10 @@  while [ "$QUIT" == "0" ]; do
 	read our_entry
 	echo ""
 	${OPTIONS[our_entry]} ${our_entry}
-	echo
-	echo -n "Press enter to continue ..."; read
+
+	if [ "$QUIT" == "0" ] ; then
+		echo
+		echo -n "Press enter to continue ..."; read
+	fi
+
 done