From 4c0b1b9c2af70838dbcf5a676ec679f9f0c488a5 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Thu, 21 Apr 2016 14:22:04 +0100 Subject: toaster: bin/toaster Add help text for unrecognised command Add help text for unrecognised or missing command for toaster script Remove assumption that no command is 'start' as the default. Signed-off-by: Michael Wood Signed-off-by: Elliot Smith Signed-off-by: Richard Purdie --- bin/toaster | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'bin/toaster') diff --git a/bin/toaster b/bin/toaster index 70c66d2c2..2d07255d9 100755 --- a/bin/toaster +++ b/bin/toaster @@ -17,10 +17,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/. -# Usage: source toaster [start|stop] -# [webport=] [noui] [noweb] - -# Helper function to kill a background toaster development server +HELP=" +Usage: source toaster start|stop [webport=] [noweb] + Optional arguments: + [noweb] Setup the environment for building with toaster but don't start the development server + [webport] Set the development server (default: localhost:8000) +" webserverKillAll() { @@ -193,6 +195,12 @@ for param in $*; do ;; webport=*) WEB_PORT="${param#*=}" + ;; + *) + echo "$HELP" + return 1 + ;; + esac done @@ -226,11 +234,9 @@ if [ "$CMD" = "start" ] ; then return 1 fi elif [ "$CMD" = "" ]; then - if [ -z "$BBSERVER" ]; then - CMD="start" - else - CMD="stop" - fi + echo "No command specified" + echo "$HELP" + return 1 fi echo "The system will $CMD." -- cgit 1.2.3-korg