diff options
author | Michael Brown <mcb30@ipxe.org> | 2012-03-29 00:05:22 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2012-03-29 14:02:02 +0100 |
commit | 3425726cf33c2af84c9737a2501cd39517e42cdb (patch) | |
tree | b08cd61419fad6e16de7e9329d91540e99a6a980 /src/include/ipxe/parseopt.h | |
parent | 493f1945314cf74c10ffb77b96667b9f725bc5c4 (diff) | |
download | ipxe-3425726cf33c2af84c9737a2501cd39517e42cdb.zip ipxe-3425726cf33c2af84c9737a2501cd39517e42cdb.tar.gz ipxe-3425726cf33c2af84c9737a2501cd39517e42cdb.tar.bz2 |
[menu] Add menu commands
Allow iPXE scripts to create menus. For example:
#!ipxe
menu iSCSI boot demonstration
item install Install Fedora to ${root-path}
item --default boot Boot from ${root-path}
item shell Enter iPXE shell
item exit Exit to BIOS
choose label && goto ${label}
:boot
sanboot ${root-path}
:install
sanhook ${root-path}
chain http://${next-server}/fedora.ipxe
:shell
shell
:exit
Inspired-by: Robin Smidsrød <robin@smidsrod.no>
Tested-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/parseopt.h')
-rw-r--r-- | src/include/ipxe/parseopt.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/ipxe/parseopt.h b/src/include/ipxe/parseopt.h index b5fd220..b492a51 100644 --- a/src/include/ipxe/parseopt.h +++ b/src/include/ipxe/parseopt.h @@ -13,6 +13,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include <stddef.h> struct net_device; +struct menu; /** A command-line option descriptor */ struct option_descriptor { @@ -116,6 +117,7 @@ struct command_descriptor { extern int parse_string ( const char *text, const char **value ); extern int parse_integer ( const char *text, unsigned int *value ); extern int parse_netdev ( const char *text, struct net_device **netdev ); +extern int parse_menu ( const char *text, struct menu **menu ); extern int parse_flag ( const char *text __unused, int *flag ); extern int parse_key ( const char *text, unsigned int *key ); extern void print_usage ( struct command_descriptor *cmd, char **argv ); |