From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from slsa667.piensasolutions.com ([217.76.150.252]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SaNIx-0007eU-Nl for barebox@lists.infradead.org; Fri, 01 Jun 2012 08:33:57 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp-02.piensasolutions.com (Postfix) with ESMTP id A59192A0906 for ; Fri, 1 Jun 2012 10:33:52 +0200 (CEST) Received: from mail-ey0-f177.google.com (mail-ey0-f177.google.com [209.85.215.177]) by smtp-02.piensasolutions.com (Postfix) with ESMTPSA id 6D8582A09EF for ; Fri, 1 Jun 2012 10:33:52 +0200 (CEST) Received: by eaaf11 with SMTP id f11so609360eaa.36 for ; Fri, 01 Jun 2012 01:33:51 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20120531200834.GE30400@pengutronix.de> References: <20120531200834.GE30400@pengutronix.de> From: Benoit RAT Date: Fri, 1 Jun 2012 10:33:31 +0200 Message-ID: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============6523213009308164529==" Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: menu autodisplay does not work To: Sascha Hauer Cc: barebox@lists.infradead.org --===============6523213009308164529== Content-Type: multipart/alternative; boundary=90e6ba615438453bf804c1650bac --90e6ba615438453bf804c1650bac Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable I think this is not a bug, it's the documentation that is not clear here. The above is only useful in conjunction with -A in which case the description given with -d is shown as timeout text. It is what I thought but even with the -A option it doesn't work: menu -m test -s -A 10 -d "test2" test menu 1: test1 2: test2 3: test3 test2 8 So test2 is correctly selected for timeout (test2 8) but when the countdown terminate I obtain 1 WRS-3> / this means that the command executed is test1 Moreover, I think it should be usefull to have a -A infinite timeout options with a preselect option to help someone choose the next step or the default step. About the -S -n option I also think it is redundant but maybe someone thought implementing -S -d -- *Benoit RAT LAMY* Engineer (Sw) \ Ingeniero (Sw) fix. *(+34) 958 285 024* cel. *(+34) 617 989 123* e-mail: benoit@sevensols.com *www.sevensols.com / **www.sevensecurity.es* _________________________________ *C/ Baza, parcela 19 Nave 3 \ Pol=EDgono Ind. Juncaril \* *18210 - PELIGROS - GRANADA =96SPAIN* On Thu, May 31, 2012 at 10:08 PM, Sascha Hauer wrot= e: > On Thu, May 31, 2012 at 05:25:03PM +0200, Benoit RAT wrote: > > Hy guy, > > > > I found a small bug with menu autodisplay functionality that doesn't > work: > > > > menu -a -m test -d "test menu" > > menu -e -a -m test -c "echo 1" -d "test1" > > menu -e -a -m test -c "echo 2" -d "test2" > > menu -e -a -m test -c "echo 3" -d "test3" > > > > And then I try to autoselect test2 after chosing test 1 > > > > 1 > > barebox> menu -m test -s -d "test2" > > I think this is not a bug, it's the documentation that is not clear > here. The above is only useful in conjunction with -A in which case > the description given with -d is shown as timeout text. > > > > > But this does not work! > > > > The only way to perform this is to use > > > > menu -m test -S -n 2 > > menu -m test -s > > That's a point I do not understand. Looking at the code it's clear to me > why this have to be two commands, but I think it should be possible to > combine the select option with the show option. Furthermore I think the > -S option is quite useless. -S seems to used only to let the -n option > take effect. > > Overall it's not very clear which options exist and which options take > an argument. I've collected them and here is the result: > > -m specify menu to work on > -l list existing menus > -s show menu > -a Add a menu or, when -e is given additionally, add a menu > entry > -r remove a menu > -d description, in conjunction with > -a -e: Menu text to show > -A: timeout text to show > -A Autoselect selected entry in seconds > -c run when an entry is selected > -R reentrance, used with -a, do not leave the menu after > an entry is selected > -b 0|1 box entry. used with -a, add a yes/no entry > -e when given with -a, add a menu entry. When given with > -l, additionally to the menu also list the entries > -S -n select entry , starting at 1. Seperate command, > NOT together with actually showing the menu > > I think we should add this to the help text for the menu command, or > even better, replace the docs and the code for -S -n with a plain > -S > > Sascha > > -- > Pengutronix e.K. | = | > Industrial Linux Solutions | http://www.pengutronix.de/ = | > Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 = | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 = | > --90e6ba615438453bf804c1650bac Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable I think this is not a bug, it's the documentation that is not clear
= here. The above is only useful in conjunction with -A in which case
the = description given with -d is shown as timeout text.

It i= s what I thought but even with the -A option it doesn't work:

menu -m test -s -A 10 -d "test2"

=A0test menu
=A0 =A0 =A0 1: test1
=A0 =A0 = =A0 2: test2
=A0 =A0 =A0 3: test3
=A0 test2 =A08

So test2 is correctly selected for timeout (test2 8) but when the countdow= n terminate I obtain

1
WRS-3> /= =A0

this means that the command executed is test1
Moreover, I think it should be usefull to have a -A infinite timeout= options with a preselect option to help someone choose the next step or th= e default step.


About the -S -n <num> option I als= o think it is redundant but maybe someone thought implementing -S -d <de= sc>



--
=A0

Benoit RAT LAMY

Engineer (Sw) \ Ingeniero (= Sw)

fix.=A0(+34) 958 285 024<= /span>

c= el.=A0(+34) 617 989 123

e-mail:=A0benoit@sevensol= s.com

www.se= vensols.com=A0/=A0www.sevensecurity.es

______________________________= ___

C/ Baza, parcela 19 Nave 3= =A0 \ Pol=EDgono Ind. Juncaril \

18210 - PELIGROS - GRANADA =96SPAIN




On Thu, May 31, 2012 at 10:08 PM, Sascha= Hauer <s.hauer@pengutronix.de> wrote:
On Thu, May 31, 2012 at 05:25:03PM +0200, Benoit RAT wrot= e:
> Hy guy,
>
> I found a small bug with menu autodisplay functionality that doesn'= ;t work:
>
> =A0menu -a -m test -d "test menu"
> =A0menu -e -a -m test -c "echo 1" -d "test1"
> =A0menu -e -a -m test -c "echo 2" -d "test2"
> =A0menu -e -a -m test -c "echo 3" -d "test3"
>
> And then I try to autoselect test2 after chosing test 1
>
> 1
> barebox> menu -m test -s -d "test2"

I think this is not a bug, it's the documentation that is not cle= ar
here. The above is only useful in conjunction with -A in which case
the description given with -d is shown as timeout text.

>
> But this does not work!
>
> The only way to perform this is to use
>
> menu -m test -S -n 2
> menu -m test -s

That's a point I do not understand. Looking at the code it's = clear to me
why this have to be two commands, but I think it should be possible to
combine the select option with the show option. Furthermore I think the
-S option is quite useless. -S seems to used only to let the -n option
take effect.

Overall it's not very clear which options exist and which options take<= br> an argument. I've collected them and here is the result:

-m <menuname> =A0 =A0specify menu to work on
-l =A0 =A0 =A0 =A0 =A0 =A0 =A0 list existing menus
-s =A0 =A0 =A0 =A0 =A0 =A0 =A0 show menu
-a =A0 =A0 =A0 =A0 =A0 =A0 =A0 Add a menu or, when -e is given additionally= , add a menu entry
-r =A0 =A0 =A0 =A0 =A0 =A0 =A0 remove a menu
-d <description> description, in conjunction with
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-a -e: Menu text to show
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-A: timeout text to show
-A <delay> =A0 =A0 =A0 Autoselect selected entry in <delay> sec= onds
-c <command> =A0 =A0 run <command> when an entry is selected -R =A0 =A0 =A0 =A0 =A0 =A0 =A0 reentrance, used with -a, do not leave the m= enu after
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 an entry is selected
-b 0|1 =A0 =A0 =A0 =A0 =A0 box entry. used with -a, add a yes/no entry
-e =A0 =A0 =A0 =A0 =A0 =A0 =A0 when given with -a, add a menu entry. When g= iven with
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 -l, additionally to the menu also list the= entries
-S -n <num> =A0 =A0 =A0select entry <num>, starting at 1. Seper= ate command,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 NOT together with actually showing the men= u

I think we should add this to the help text for the menu command, or
even better, replace the docs and the code for -S -n <num> with a pla= in
-S <num>

Sascha

--
Pengutronix e.K. =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 |
Industrial Linux Solutions =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | http://www.pengutronix.de/ = =A0|
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 =A0 =A0|
Amtsgericht Hildesheim, HRA 2686 =A0 =A0 =A0 =A0 =A0 | Fax: =A0 +49-5121-206917-555= 5 |

--90e6ba615438453bf804c1650bac-- --===============6523213009308164529== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox --===============6523213009308164529==--