Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
cmd:choose [2012/03/29 00:34]
mcb30
cmd:choose [2012/04/28 22:34]
mcb30
Line 3: Line 3:
 ===== Synopsis ===== ===== Synopsis =====
  
-    choose [--menu <​menu>​] [--timeout <​timeout>​] [--keep] <​setting>​+    choose [--menu <menu>] [--default <label>] [--timeout <​timeout>​] 
 +           [--keep] <​setting>​
  
 ===== Examples ===== ===== Examples =====
Line 16: Line 17:
 === Choose from a menu and go to the chosen script label === === Choose from a menu and go to the chosen script label ===
  
-    choose ​label && goto ${label}+    choose ​target ​&& goto ${target}
  
-=== Choose from menu with a three-second timeout ===+=== Choose from menu with a default and a three-second timeout ===
  
-    choose --timeout 3000 label+    ​menu 
 +    item linux    Boot Linux 
 +    item shell    Enter iPXE shell 
 +    item exit     Exit to BIOS 
 +    ​choose ​--default exit --timeout 3000 target && goto ${target}
  
 ===== Description ===== ===== Description =====
  
-Choose an item from a menu and store the result in the specified [[:​settings|setting]], ​waiting for the specified timeout (in milliseconds). ​ If no timeout is explicitly specified, or if a zero timeout is specified, then iPXE will wait indefinitely. ​ If no menu is specified, the default (unnamed) menu will be used.+Choose an item from a menu and store the result in the specified [[:​settings|setting]], ​defaulting to the specified item after the specified timeout (in milliseconds). 
 + 
 +If no timeout is explicitly specified, or if a zero timeout is specified, then iPXE will wait indefinitely.  If no default item is explicitly specified, then the menu's pre-existing default item (if any) will be used.  If no menu is specified, the default (unnamed) menu will be used.
  
 {{ :​screenshots:​menu.png?​360x200 |A sample menu}} {{ :​screenshots:​menu.png?​360x200 |A sample menu}}
Line 47: Line 54:
  
     choose os || goto cancelled     choose os || goto cancelled
 +
 +The ''​--default''​ option for the ''​choose''​ command overrides any default item specified using the ''​[[:​cmd:​item]]''​ command.
  
 You can use any valid setting name, including a scope and type.  For example: You can use any valid setting name, including a scope and type.  For example:
cmd/choose.txt · Last modified: 2014/01/23 02:37 by mcb30
Recent changes RSS feed CC Attribution-Share Alike 4.0 International Driven by DokuWiki
All uses of this content must include an attribution to the iPXE project and the URL https://ipxe.org
References to "iPXE" may not be altered or removed.