I think this is not a bug, it's the documentation that is not clear<br>here. The above is only useful in conjunction with -A in which case<br>the description given with -d is shown as timeout text.<div><br></div><div>It is what I thought but even with the -A option it doesn't work:</div>
<div><br></div><div><div>menu -m test -s -A 10 -d "test2"</div></div><div><br></div><div><div> test menu</div><div> <span style="background-color:rgb(192,192,192)">1: test1</span></div><div> 2: test2</div>
<div> 3: test3</div><div> test2 8</div><div><br></div><div>So test2 is correctly selected for timeout (test2 8) but when the countdown terminate I obtain</div><div><br></div><div><div>1</div><div>WRS-3> / </div>
</div><div><br></div><div>this means that the command executed is test1</div><div>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.</div>
<div><br></div><div><br></div><div>About the -S -n <num> option I also think it is redundant but maybe someone thought implementing -S -d <desc></div><div><br></div><div><br></div><br><span style="font-family:'Times New Roman';font-size:medium">--</span><br style="font-family:'Times New Roman';font-size:medium">
<div style="font-family:'Times New Roman';font-size:medium"><a href="http://www.sevensols.com/" target="_blank"><img src="http://www.sevensols.com/logos/logo-118x90.png"></a> <a href="http://www.sevensecurity.es" style="margin-left:10px" target="_blank"><img src="http://www.sevensols.com/logos/logo-7Sec-216x90.png"></a></div>
<br style="font-family:'Times New Roman';font-size:medium"><div style="font-family:'Times New Roman';font-size:medium"><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse;line-height:15px"><b><span lang="EN-US" style="font-family:'Caecilia LT Std Light',serif;color:rgb(16,138,208)">Benoit RAT LAMY</span></b></span></div>
<div><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:15px;font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><span lang="EN-US" style="font-family:'Caecilia LT Std Light',serif;color:rgb(16,138,208)">Engineer (Sw) \ Ingeniero (Sw)</span></p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:15px;font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><span lang="EN-US" style="font-family:'Caecilia LT Std Light',serif;color:rgb(16,138,208)">fix. <b>(+34) 958 285 024</b></span></p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:15px;font-size:13px;border-collapse:collapse"><span style="color:rgb(16,138,208);font-family:'Caecilia LT Std Light',serif">cel. </span><b style="color:rgb(16,138,208);font-family:'Caecilia LT Std Light',serif">(+34) 617 989 123</b></p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:15px;font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><span lang="EN-US" style="font-family:'Caecilia LT Std Light',serif;color:rgb(16,138,208)">e-mail: <a href="mailto:benoit@sevensols.com" target="_blank"><font color="#339999">benoit@sevensols.com</font></a></span></p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:15px;font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><b><span lang="ES-TRAD" style="font-family:'Caecilia LT Std Light',serif"><span style="text-decoration:none"><font color="#339999"><a href="http://www.sevensols.com/" target="_blank">www.sevensols.com</a> / </font></span></span></b><span lang="ES-TRAD" style="font-family:'Caecilia LT Std Light',serif;color:rgb(16,138,208)"></span><b><span lang="ES-TRAD" style="font-family:'Caecilia LT Std Light',serif"><font color="#339999"><a href="http://www.sevensecurity.es" target="_blank">www.sevensecurity.es</a></font></span></b></p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:15px;font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><span lang="ES-TRAD" style="font-family:'Caecilia LT Std Light',serif;color:rgb(16,138,208)">_________________________________</span></p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:15px;font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><b><span lang="ES-TRAD" style="font-family:'Caecilia LT Std Light',serif;color:rgb(16,138,208)">C/ Baza, parcela 19 Nave 3 \ Polígono Ind. Juncaril \</span></b></p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><b><span style="font-family:'Caecilia LT Std Light',serif;color:rgb(16,138,208)">18210 - PELIGROS - GRANADA –SPAIN</span></b></p>
</div><br>
<br><br><div class="gmail_quote">On Thu, May 31, 2012 at 10:08 PM, Sascha Hauer <span dir="ltr"><<a href="mailto:s.hauer@pengutronix.de" target="_blank">s.hauer@pengutronix.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Thu, May 31, 2012 at 05:25:03PM +0200, Benoit RAT wrote:<br>
> Hy guy,<br>
><br>
> I found a small bug with menu autodisplay functionality that doesn't work:<br>
><br>
> menu -a -m test -d "test menu"<br>
> menu -e -a -m test -c "echo 1" -d "test1"<br>
> menu -e -a -m test -c "echo 2" -d "test2"<br>
> menu -e -a -m test -c "echo 3" -d "test3"<br>
><br>
> And then I try to autoselect test2 after chosing test 1<br>
><br>
> 1<br>
> barebox> menu -m test -s -d "test2"<br>
<br>
</div>I think this is not a bug, it's the documentation that is not clear<br>
here. The above is only useful in conjunction with -A in which case<br>
the description given with -d is shown as timeout text.<br>
<div class="im"><br>
><br>
> But this does not work!<br>
><br>
> The only way to perform this is to use<br>
><br>
> menu -m test -S -n 2<br>
> menu -m test -s<br>
<br>
</div>That's a point I do not understand. Looking at the code it's clear to me<br>
why this have to be two commands, but I think it should be possible to<br>
combine the select option with the show option. Furthermore I think the<br>
-S option is quite useless. -S seems to used only to let the -n option<br>
take effect.<br>
<br>
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:<br>
<br>
-m <menuname> specify menu to work on<br>
-l list existing menus<br>
-s show menu<br>
-a Add a menu or, when -e is given additionally, add a menu entry<br>
-r remove a menu<br>
-d <description> description, in conjunction with<br>
-a -e: Menu text to show<br>
-A: timeout text to show<br>
-A <delay> Autoselect selected entry in <delay> seconds<br>
-c <command> run <command> when an entry is selected<br>
-R reentrance, used with -a, do not leave the menu after<br>
an entry is selected<br>
-b 0|1 box entry. used with -a, add a yes/no entry<br>
-e when given with -a, add a menu entry. When given with<br>
-l, additionally to the menu also list the entries<br>
-S -n <num> select entry <num>, starting at 1. Seperate command,<br>
NOT together with actually showing the menu<br>
<br>
I think we should add this to the help text for the menu command, or<br>
even better, replace the docs and the code for -S -n <num> with a plain<br>
-S <num><br>
<span class="HOEnZb"><font color="#888888"><br>
Sascha<br>
<br>
--<br>
Pengutronix e.K. | |<br>
Industrial Linux Solutions | <a href="http://www.pengutronix.de/" target="_blank">http://www.pengutronix.de/</a> |<br>
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: <a href="tel:%2B49-5121-206917-0" value="+4951212069170">+49-5121-206917-0</a> |<br>
Amtsgericht Hildesheim, HRA 2686 | Fax: <a href="tel:%2B49-5121-206917-5555" value="+4951212069175555">+49-5121-206917-5555</a> |<br>
</font></span></blockquote></div><br></div>