[Toaster] [PATCH 1/3] toaster: bin/toaster Add help text for unrecognised command
Smith, Elliot
elliot.smith at intel.com
Thu Apr 21 06:22:46 PDT 2016
Added to toaster-next and submitted to bitbake-devel.
Elliot
On 20 April 2016 at 18:46, Michael Wood <michael.g.wood at intel.com> wrote:
> 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 <michael.g.wood at intel.com>
> ---
> bitbake/bin/toaster | 24 +++++++++++++++---------
> 1 file changed, 15 insertions(+), 9 deletions(-)
>
> diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
> index 70c66d2..2d07255 100755
> --- a/bitbake/bin/toaster
> +++ b/bitbake/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=<port>] [noui] [noweb]
> -
> -# Helper function to kill a background toaster development server
> +HELP="
> +Usage: source toaster start|stop [webport=<address:port>] [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."
> --
> 2.1.4
>
> --
> _______________________________________________
> toaster mailing list
> toaster at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster
>
--
Elliot Smith
Software Engineer
Intel Open Source Technology Centre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/toaster/attachments/20160421/d0bc557f/attachment.html>
More information about the toaster
mailing list