summaryrefslogtreecommitdiffstats
path: root/src/core/parseopt.c
Commit message (Collapse)AuthorAgeFilesLines
* [cmdline] Generate command option help text automaticallyMichael Brown2013-11-071-2/+19
| | | | | | | Generate the command option help text automatically from the list of defined options. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Add parse_netdev_configurator()Michael Brown2013-11-051-0/+23
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Add parse_timeout()Michael Brown2013-11-011-0/+22
| | | | | | | | Parsing a timeout value (specified in milliseconds) into an internal timeout value measured in timer ticks is a common operation. Provide a parse_timeout() value to carry out this conversion automatically. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [params] Add support for the general concept of a form parameter listMichael Brown2013-08-191-0/+24
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Add parse_setting()Michael Brown2013-07-221-0/+55
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Move parse_settings() to parseopt.cMichael Brown2013-07-221-0/+23
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Allow parsed option to be modifiedMichael Brown2013-07-221-7/+7
| | | | | | | Parsing a setting name requires the ability to modify the text being parsed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-201-1/+2
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [menu] Add menu commandsMichael Brown2012-03-291-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [parseopt] Allow "prompt" command to accept character literals for --keyMichael Brown2012-03-291-1/+19
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify image management commands and internal APIMichael Brown2012-03-251-22/+0Star
| | | | | | | | | | | | | | | | | | | | | | Remove the name, cmdline, and action parameters from imgdownload() and imgdownload_string(). These functions now simply download and return an image. Add the function imgacquire(), which will interpret a "name or URI string" parameter and return either an existing image or a newly downloaded image. Use imgacquire() to merge similar image-management commands that currently differ only by whether they take the name of an existing image or the URI of a new image to download. For example, "chain" and "imgexec" can now be merged. Extend imgstat and imgfree commands to take an optional list of images. Remove the arbitrary restriction on the length of image names. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Disambiguate the various EINVAL errorsMichael Brown2011-05-181-2/+16
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Allow for pre-initialised option setsMichael Brown2011-04-241-7/+22
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Add support for boolean optionsMichael Brown2011-03-271-0/+15
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Refer to online documentation for command helpMichael Brown2011-03-041-1/+2
| | | | | | | | | | The online documentation (e.g. http://ipxe.org/cmd/ifopen), though not yet complete, is far more comprehensive than could be provided within the iPXE binary. Save around 200 bytes (compressed) by removing the command descriptions from the interactive help, and instead referring users directly to the web page describing the relevant command. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Allow "0x"-prefixed hexadecimal values in integer-valued optionsMichael Brown2010-11-291-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Add generic option-parsing libraryMichael Brown2010-11-211-0/+219
Command implementations tend to include a substantial amount of common boilerplate code revolving around the parsing of command-line options and arguments. This increases the size cost of each command. Introduce an option-parsing library that abstracts out the common operations involved in command implementations. This enables the size of each individual command to be reduced, and also enhances consistency between commands. Total size of the library is 704 bytes, to be amortised across all command implementations. Signed-off-by: Michael Brown <mcb30@ipxe.org>