treewide: add usage help to various iocsh functions

This commit is contained in:
Minijackson
2022-06-20 08:09:42 -07:00
committed by Michael Davidsaver
parent 19daf6136f
commit a722bb9289
10 changed files with 148 additions and 23 deletions
@@ -17,7 +17,17 @@ void hello(const char *name) {
/* Information needed by iocsh */
static const iocshArg helloArg0 = {"name", iocshArgString};
static const iocshArg *helloArgs[] = {&helloArg0};
static const iocshFuncDef helloFuncDef = {"hello", 1, helloArgs};
static const iocshFuncDef helloFuncDef = {
"hello",
1,
helloArgs,
#ifdef IOCSHFUNCDEF_HAS_USAGE
"Greet the person whose name is given as first argument.\n"
"If 'name' is unspecified, greet the world in general.\n\n"
"Example: hello\n"
"Example: hello stranger\n",
#endif
};
/* Wrapper called by iocsh, selects the argument types that hello needs */
static void helloCallFunc(const iocshArgBuf *args) {
@@ -28,7 +28,14 @@ int traceIocInit(void) {
}
static const iocshFuncDef traceInitFuncDef = {"traceIocInit", 0, NULL};
static const iocshFuncDef traceInitFuncDef = {
"traceIocInit",
0,
NULL,
"Setup the 'iocInit' function to trace its different stages.\n"
"This function must be called before 'iocInit'.\n\n"
"Example: traceIocInit\n",
};
static void traceInitFunc(const iocshArgBuf *args) {
traceIocInit();
}