File wsh_shell_option.h
FileList > src > wsh_shell_option.h
Go to the source code of this file
Definition of shell command-line option object and creation macros. More...
#include "wsh_shell_types.h"
Classes
| Type | Name |
|---|---|
| struct | WshShellOption_Ctx_t Option usage context during parsing. |
| struct | WshShellOption_t Represents a shell command-line option. |
Public Types
| Type | Name |
|---|---|
| enum | WSH_SHELL_OPTION_TYPE_t Enumeration of all option types used by the shell. |
Public Static Attributes
| Type | Name |
|---|---|
| const WshShell_Char_t * | WshShell_OptionTypeNames = /* multi line expression */Human-readable names of option types. |
Public Static Functions
| Type | Name |
|---|---|
| const WshShell_Char_t * | WshShell_OptTypeStr_Get (WSH_SHELL_OPTION_TYPE_t optType) Return the string name of an option type. |
Macros
| Type | Name |
|---|---|
| define | WSH_SHELL_OPTION_TYPES_TABLE () /* multi line expression */Internal macro: full list of option types. |
| define | WSH_SHELL_OPT_ACCESS_ADMIN 0x08 |
| define | WSH_SHELL_OPT_ACCESS_ANY (WSH\_SHELL\_OPT\_ACCESS\_READ \| WSH\_SHELL\_OPT\_ACCESS\_WRITE \| WSH\_SHELL\_OPT\_ACCESS\_EXECUTE) |
| define | WSH_SHELL_OPT_ACCESS_EXECUTE 0x04 |
| define | WSH_SHELL_OPT_ACCESS_NO 0x00 |
| define | WSH_SHELL_OPT_ACCESS_READ 0x01 |
| define | WSH_SHELL_OPT_ACCESS_WRITE 0x02 |
| define | WSH_SHELL_OPT_DESCR (descr) "" |
| define | WSH_SHELL_OPT_END () WSH\_SHELL\_OPTION\_END, WSH\_SHELL\_OPT\_ACCESS\_ANY, 0, NULL, NULL, NULLMarks the end of an option array. |
| define | WSH_SHELL_OPT_FLOAT (acc, short, long, descr) WSH\_SHELL\_OPTION\_FLOAT, (acc), 1, (short), (long), WSH\_SHELL\_OPT\_DESCR(descr)Define a float argument option. |
| define | WSH_SHELL_OPT_HELP () /* multi line expression */Define a built-in help option (e.g. "--help" or"-h" ). |
| define | WSH_SHELL_OPT_INT (acc, short, long, descr) WSH\_SHELL\_OPTION\_INT, (acc), 1, (short), (long), WSH\_SHELL\_OPT\_DESCR(descr)Define an integer argument option. |
| define | WSH_SHELL_OPT_INTERACT (acc) /* multi line expression */Define an option for entering interactive mode. |
| define | WSH_SHELL_OPT_MULTI_ARG (acc, argnum, short, long, descr) WSH\_SHELL\_OPTION\_MULTI\_ARG, (acc), (argnum), (short), (long), WSH\_SHELL\_OPT\_DESCR(descr)Define an option that accepts multiple arguments. |
| define | WSH_SHELL_OPT_NO (acc, descr) WSH\_SHELL\_OPTION\_NO, (acc), 0, "--", "---", WSH\_SHELL\_OPT\_DESCR(descr)Define a special option that matches the command name only (no flags). |
| define | WSH_SHELL_OPT_STR (acc, short, long, descr) WSH\_SHELL\_OPTION\_STR, (acc), 1, (short), (long), WSH\_SHELL\_OPT\_DESCR(descr)Define a string argument option. |
| define | WSH_SHELL_OPT_WAITS_INPUT (acc) WSH\_SHELL\_OPTION\_WAITS\_INPUT, (acc), 0, NULL, NULL, NULLDefine an option that triggers when input is provided with no flags. |
| define | WSH_SHELL_OPT_WO_PARAM (acc, short, long, descr) WSH\_SHELL\_OPTION\_WO\_PARAM, (acc), 0, (short), (long), WSH\_SHELL\_OPT\_DESCR(descr)Define an option that requires no arguments. |
| define | X_ENTRY (id, str) id, |
| define | X_ENTRY (id, str) id, |
Detailed Description
This file provides structures and macros for defining and managing command-line options in the WSH shell framework.
Author:
Whoosh Embedded Team
Copyright:
Copyright (c) 2024
Public Types Documentation
enum WSH_SHELL_OPTION_TYPE_t
Enumeration of all option types used by the shell.
Public Static Attributes Documentation
variable WshShell_OptionTypeNames
Human-readable names of option types.
Public Static Functions Documentation
function WshShell_OptTypeStr_Get
Return the string name of an option type.
Parameters:
optTypeThe option type.
Returns:
Option type name as string.
Macro Definition Documentation
define WSH_SHELL_OPTION_TYPES_TABLE
Internal macro: full list of option types.
define WSH_SHELL_OPT_ACCESS_ADMIN
define WSH_SHELL_OPT_ACCESS_ANY
define WSH_SHELL_OPT_ACCESS_EXECUTE
define WSH_SHELL_OPT_ACCESS_NO
define WSH_SHELL_OPT_ACCESS_READ
define WSH_SHELL_OPT_ACCESS_WRITE
define WSH_SHELL_OPT_DESCR
define WSH_SHELL_OPT_END
Marks the end of an option array.
define WSH_SHELL_OPT_FLOAT
Define a float argument option.
Parameters:
accAccess rights mask.shortShort flag.longLong flag.descrHelp description.
define WSH_SHELL_OPT_HELP
Define a built-in help option (e.g. "--help" or"-h" ).
define WSH_SHELL_OPT_INT
Define an integer argument option.
Parameters:
accAccess rights mask.shortShort flag.longLong flag.descrHelp description.
define WSH_SHELL_OPT_INTERACT
Define an option for entering interactive mode.
define WSH_SHELL_OPT_MULTI_ARG
Define an option that accepts multiple arguments.
Parameters:
accAccess rights mask.argnumNumber of arguments.shortShort flag.longLong flag.descrHelp description.
define WSH_SHELL_OPT_NO
Define a special option that matches the command name only (no flags).
Parameters:
accAccess rights mask.
define WSH_SHELL_OPT_STR
Define a string argument option.
Parameters:
accAccess rights mask.shortShort flag.longLong flag.descrHelp description.
define WSH_SHELL_OPT_WAITS_INPUT
Define an option that triggers when input is provided with no flags.
Parameters:
accAccess rights mask.
define WSH_SHELL_OPT_WO_PARAM
Define an option that requires no arguments.
Parameters:
accAccess rights mask.shortShort flag (e.g."-a").longLong flag (e.g."--all").descrHelp description.
define X_ENTRY
define X_ENTRY
The documentation for this class was generated from the following file src/wsh_shell_option.h