UEFIStarter
a simple UEFI framework
Functions | Variables
helloworld.c File Reference

This application is a simple example of how to read command line arguments and output to console. More...

#include <Uefi.h>
#include <Library/UefiLib.h>
#include <Library/ShellCEntryLib.h>
#include <UEFIStarter/core.h>

Functions

BOOLEAN validate_int (cmdline_value_t value)
 Validator function for "-int" parameter. More...
 
INTN EFIAPI ShellAppMain (UINTN argc, CHAR16 **argv)
 Main function, gets invoked by UEFI shell. More...
 

Variables

cmdline_argument_t args1 []
 command-line arguments in group 1 More...
 
cmdline_argument_group_t _arg_group1 ={ L"Group 1" ,sizeof( args1 )/sizeof(cmdline_argument_t), args1 }
 command-line argument group 1
 
cmdline_argument_t args2 []
 command-line arguments in group 2 More...
 
cmdline_argument_group_t _arg_group2 ={ L"Group 2" ,sizeof( args2 )/sizeof(cmdline_argument_t), args2 }
 command-line argument group 2
 

Detailed Description

This application is a simple example of how to read command line arguments and output to console.

Author
Richard Nusser
License
GPLv3 (see http://www.gnu.org/licenses/)
See also
https://github.com/rinusser/UEFIStarter

Function Documentation

◆ validate_int()

BOOLEAN validate_int ( cmdline_value_t  value)

Validator function for "-int" parameter.

Values must be greater than or equal to 2 to be valid.

Parameters
valuethe value to validate
Returns
whether the value is >=2

◆ ShellAppMain()

INTN EFIAPI ShellAppMain ( UINTN  argc,
CHAR16 **  argv 
)

Main function, gets invoked by UEFI shell.

Parameters
argcthe number of command-line arguments passed
argvthe command-line arguments passed
Returns
an EFI status code for the shell

Variable Documentation

◆ args1

Initial value:
= {
{{uint64:0},ARG_BOOL, NULL,L"-bool",L"boolean parameter"},
{{dbl:0.66},ARG_DOUBLE,NULL,L"-dbl", L"double parameter"},
}
boolean
Definition: cmdline.h:22
double
Definition: cmdline.h:24

command-line arguments in group 1

◆ args2

Initial value:
= {
{{uint64:2},ARG_INT,validate_int,L"-int",L"integer parameter"},
}
BOOLEAN validate_int(cmdline_value_t value)
Validator function for "-int" parameter.
Definition: helloworld.c:24
integer
Definition: cmdline.h:23

command-line arguments in group 2