File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ interaction is required. This module is a Unix-like shell with these features:
3030* Built-in handler to display help for the commands.
3131* Support for wildcards: ``* `` and ``? ``.
3232* Support for meta keys.
33+ * Support for getopt.
3334* Kconfig configuration to optimize memory usage.
3435
3536.. note ::
@@ -480,6 +481,28 @@ The shell module supports the following meta keys:
480481
481482This feature is activated by :option: `CONFIG_SHELL_METAKEYS ` set to ``y ``.
482483
484+ Getopt Feature
485+ *****************
486+
487+ Some shell users apart from subcommands might need to use options as well.
488+ the arguments string, looking for supported options. Typically, this task
489+ is accomplished by the ``getopt `` function.
490+
491+ For this purpose shell supports the getopt library available
492+ in the FreeBSD project. I was modified so that it can be used
493+ by all instances of the shell at the same time, hence its call requires
494+ one more parameter.
495+
496+ An example usage:
497+
498+ .. code-block :: c
499+
500+ while ((char c = shell_getopt(shell, argc, argv, "abhc:")) != -1) {
501+ /* some code */
502+ }
503+
504+ This module is activated by :option: `CONFIG_SHELL_GETOPT ` set to ``y ``.
505+
483506Shell Logger Backend Feature
484507****************************
485508
You can’t perform that action at this time.
0 commit comments