diff --git a/documentation/RELEASE_NOTES.md b/documentation/RELEASE_NOTES.md index 58b27947df..f25059ebf3 100644 --- a/documentation/RELEASE_NOTES.md +++ b/documentation/RELEASE_NOTES.md @@ -14,6 +14,15 @@ release. ## EPICS Release 7.0.3.2 +### IOCsh usage messages + +`help ` now prints a descriptive usage message +for many internal IOCsh commands. Try `help *` to +see them all. + +External code which wishes to provide a usage message +should do so through the new `iocshFuncDef::usage` member. + ### Variable names in RELEASE files `configure/RELEASE` files are parsed by both GNUmake and the `convertRelease.pl` diff --git a/modules/database/src/ioc/as/asIocRegister.c b/modules/database/src/ioc/as/asIocRegister.c index d5926a551b..2fa79dfb0c 100644 --- a/modules/database/src/ioc/as/asIocRegister.c +++ b/modules/database/src/ioc/as/asIocRegister.c @@ -19,7 +19,9 @@ static const iocshArg asSetFilenameArg0 = { "ascf",iocshArgString}; static const iocshArg * const asSetFilenameArgs[] = {&asSetFilenameArg0}; static const iocshFuncDef asSetFilenameFuncDef = - {"asSetFilename",1,asSetFilenameArgs}; + {"asSetFilename",1,asSetFilenameArgs, + "Set path+file name of ACF file.\n" + "No immediate effect. Run as asInit() to (re)load.\n"}; static void asSetFilenameCallFunc(const iocshArgBuf *args) { asSetFilename(args[0].sval); @@ -29,21 +31,25 @@ static void asSetFilenameCallFunc(const iocshArgBuf *args) static const iocshArg asSetSubstitutionsArg0 = { "substitutions",iocshArgString}; static const iocshArg * const asSetSubstitutionsArgs[] = {&asSetSubstitutionsArg0}; static const iocshFuncDef asSetSubstitutionsFuncDef = - {"asSetSubstitutions",1,asSetSubstitutionsArgs}; + {"asSetSubstitutions",1,asSetSubstitutionsArgs, + "Set subtitutions used when reading ACF file.\n" + "No immediate effect. Run as asInit() to (re)load.\n"}; static void asSetSubstitutionsCallFunc(const iocshArgBuf *args) { asSetSubstitutions(args[0].sval); } /* asInit */ -static const iocshFuncDef asInitFuncDef = {"asInit",0}; +static const iocshFuncDef asInitFuncDef = {"asInit",0,0, + "(Re)load ACF file.\n"}; static void asInitCallFunc(const iocshArgBuf *args) { iocshSetError(asInit()); } /* asdbdump */ -static const iocshFuncDef asdbdumpFuncDef = {"asdbdump",0}; +static const iocshFuncDef asdbdumpFuncDef = {"asdbdump",0,0, + "Dump processed ACF file (as read).\n"}; static void asdbdumpCallFunc(const iocshArgBuf *args) { asdbdump(); @@ -52,7 +58,8 @@ static void asdbdumpCallFunc(const iocshArgBuf *args) /* aspuag */ static const iocshArg aspuagArg0 = { "uagname",iocshArgString}; static const iocshArg * const aspuagArgs[] = {&aspuagArg0}; -static const iocshFuncDef aspuagFuncDef = {"aspuag",1,aspuagArgs}; +static const iocshFuncDef aspuagFuncDef = {"aspuag",1,aspuagArgs, + "Show members of User Access Group.\n"}; static void aspuagCallFunc(const iocshArgBuf *args) { aspuag(args[0].sval); @@ -61,7 +68,8 @@ static void aspuagCallFunc(const iocshArgBuf *args) /* asphag */ static const iocshArg asphagArg0 = { "hagname",iocshArgString}; static const iocshArg * const asphagArgs[] = {&asphagArg0}; -static const iocshFuncDef asphagFuncDef = {"asphag",1,asphagArgs}; +static const iocshFuncDef asphagFuncDef = {"asphag",1,asphagArgs, + "Show members of Host Access Group.\n"}; static void asphagCallFunc(const iocshArgBuf *args) { asphag(args[0].sval); @@ -70,7 +78,8 @@ static void asphagCallFunc(const iocshArgBuf *args) /* asprules */ static const iocshArg asprulesArg0 = { "asgname",iocshArgString}; static const iocshArg * const asprulesArgs[] = {&asprulesArg0}; -static const iocshFuncDef asprulesFuncDef = {"asprules",1,asprulesArgs}; +static const iocshFuncDef asprulesFuncDef = {"asprules",1,asprulesArgs, + "List rules of an Access Security Group.\n"}; static void asprulesCallFunc(const iocshArgBuf *args) { asprules(args[0].sval); @@ -80,7 +89,8 @@ static void asprulesCallFunc(const iocshArgBuf *args) static const iocshArg aspmemArg0 = { "asgname",iocshArgString}; static const iocshArg aspmemArg1 = { "clients",iocshArgInt}; static const iocshArg * const aspmemArgs[] = {&aspmemArg0,&aspmemArg1}; -static const iocshFuncDef aspmemFuncDef = {"aspmem",2,aspmemArgs}; +static const iocshFuncDef aspmemFuncDef = {"aspmem",2,aspmemArgs, + "List members of Access Security Group.\n"}; static void aspmemCallFunc(const iocshArgBuf *args) { aspmem(args[0].sval,args[1].ival); @@ -89,9 +99,10 @@ static void aspmemCallFunc(const iocshArgBuf *args) /* astac */ static const iocshArg astacArg0 = { "recordname",iocshArgString}; static const iocshArg astacArg1 = { "user",iocshArgString}; -static const iocshArg astacArg2 = { "location",iocshArgString}; +static const iocshArg astacArg2 = { "host",iocshArgString}; static const iocshArg * const astacArgs[] = {&astacArg0,&astacArg1,&astacArg2}; -static const iocshFuncDef astacFuncDef = {"astac",3,astacArgs}; +static const iocshFuncDef astacFuncDef = {"astac",3,astacArgs, + "Test Access Security privlages granted to user+host.\n"}; static void astacCallFunc(const iocshArgBuf *args) { astac(args[0].sval,args[1].sval,args[2].sval); @@ -100,7 +111,8 @@ static void astacCallFunc(const iocshArgBuf *args) /* ascar */ static const iocshArg ascarArg0 = { "level",iocshArgInt}; static const iocshArg * const ascarArgs[] = {&ascarArg0}; -static const iocshFuncDef ascarFuncDef = {"ascar",1,ascarArgs}; +static const iocshFuncDef ascarFuncDef = {"ascar",1,ascarArgs, + "Report status of PVs used in INP*() Access Security rules.\n"}; static void ascarCallFunc(const iocshArgBuf *args) { ascar(args[0].ival); diff --git a/modules/database/src/ioc/db/dbIocRegister.c b/modules/database/src/ioc/db/dbIocRegister.c index afb31151d4..2c3a813936 100644 --- a/modules/database/src/ioc/db/dbIocRegister.c +++ b/modules/database/src/ioc/db/dbIocRegister.c @@ -55,56 +55,69 @@ static void dbLoadRecordsCallFunc(const iocshArgBuf *args) /* dbb */ static const iocshArg dbbArg0 = { "record name",iocshArgString}; static const iocshArg * const dbbArgs[1] = {&dbbArg0}; -static const iocshFuncDef dbbFuncDef = {"dbb",1,dbbArgs}; +static const iocshFuncDef dbbFuncDef = {"dbb",1,dbbArgs, + "Add breakpoint to a lock set.\n"}; static void dbbCallFunc(const iocshArgBuf *args) { dbb(args[0].sval);} /* dbd */ static const iocshArg dbdArg0 = { "record name",iocshArgString}; static const iocshArg * const dbdArgs[1] = {&dbdArg0}; -static const iocshFuncDef dbdFuncDef = {"dbd",1,dbdArgs}; +static const iocshFuncDef dbdFuncDef = {"dbd",1,dbdArgs, + "Remove breakpoint from a record.\n"}; static void dbdCallFunc(const iocshArgBuf *args) { dbd(args[0].sval);} /* dbc */ static const iocshArg dbcArg0 = { "record name",iocshArgString}; static const iocshArg * const dbcArgs[1] = {&dbcArg0}; -static const iocshFuncDef dbcFuncDef = {"dbc",1,dbcArgs}; +static const iocshFuncDef dbcFuncDef = {"dbc",1,dbcArgs, + "Continue processing in a lock set.\n"}; static void dbcCallFunc(const iocshArgBuf *args) { dbc(args[0].sval);} /* dbs */ static const iocshArg dbsArg0 = { "record name",iocshArgString}; static const iocshArg * const dbsArgs[1] = {&dbsArg0}; -static const iocshFuncDef dbsFuncDef = {"dbs",1,dbsArgs}; +static const iocshFuncDef dbsFuncDef = {"dbs",1,dbsArgs, + "Step through record processing.\n"}; static void dbsCallFunc(const iocshArgBuf *args) { dbs(args[0].sval);} /* dbstat */ -static const iocshFuncDef dbstatFuncDef = {"dbstat",0}; +static const iocshFuncDef dbstatFuncDef = {"dbstat",0,0, + "print list of stopped records, and breakpoints set in locksets.\n"}; static void dbstatCallFunc(const iocshArgBuf *args) { dbstat();} /* dbp */ static const iocshArg dbpArg0 = { "record name",iocshArgString}; static const iocshArg dbpArg1 = { "interest level",iocshArgInt}; static const iocshArg * const dbpArgs[2] = {&dbpArg0,&dbpArg1}; -static const iocshFuncDef dbpFuncDef = {"dbp",2,dbpArgs}; +static const iocshFuncDef dbpFuncDef = {"dbp",2,dbpArgs, + "print stopped record.\n"}; static void dbpCallFunc(const iocshArgBuf *args) { dbp(args[0].sval,args[1].ival);} /* dbap */ static const iocshArg dbapArg0 = { "record name",iocshArgString}; static const iocshArg * const dbapArgs[1] = {&dbapArg0}; -static const iocshFuncDef dbapFuncDef = {"dbap",1,dbapArgs}; +static const iocshFuncDef dbapFuncDef = {"dbap",1,dbapArgs, + "toggle printing after processing a certain record.\n"}; static void dbapCallFunc(const iocshArgBuf *args) { dbap(args[0].sval);} /* dbsr */ static const iocshArg dbsrArg0 = { "interest level",iocshArgInt}; static const iocshArg * const dbsrArgs[1] = {&dbsrArg0}; -static const iocshFuncDef dbsrFuncDef = {"dbsr",1,dbsrArgs}; +static const iocshFuncDef dbsrFuncDef = {"dbsr",1,dbsrArgs, + "Database Server Report.\n"}; static void dbsrCallFunc(const iocshArgBuf *args) { dbsr(args[0].ival);} /* dbcar */ static const iocshArg dbcarArg0 = { "record name",iocshArgString}; static const iocshArg dbcarArg1 = { "level",iocshArgInt}; static const iocshArg * const dbcarArgs[2] = {&dbcarArg0,&dbcarArg1}; -static const iocshFuncDef dbcarFuncDef = {"dbcar",2,dbcarArgs}; +static const iocshFuncDef dbcarFuncDef = {"dbcar",2,dbcarArgs, + "Database Channel Access Report.\n" + "Shows status of Channel Access links (CA_LINK).\n" + "interest level 0 - Shows statistics for all links.\n" + " 1 - Shows info. of only disconnected links.\n" + " 2 - Shows info. for all links.\n"}; static void dbcarCallFunc(const iocshArgBuf *args) { dbcar(args[0].sval,args[1].ival); @@ -114,7 +127,8 @@ static void dbcarCallFunc(const iocshArgBuf *args) static const iocshArg dbjlrArg0 = { "record name",iocshArgString}; static const iocshArg dbjlrArg1 = { "level",iocshArgInt}; static const iocshArg * const dbjlrArgs[2] = {&dbjlrArg0,&dbjlrArg1}; -static const iocshFuncDef dbjlrFuncDef = {"dbjlr",2,dbjlrArgs}; +static const iocshFuncDef dbjlrFuncDef = {"dbjlr",2,dbjlrArgs, + "Database JSON link Report.\n"}; static void dbjlrCallFunc(const iocshArgBuf *args) { dbjlr(args[0].sval,args[1].ival); @@ -124,7 +138,9 @@ static void dbjlrCallFunc(const iocshArgBuf *args) static const iocshArg dbelArg0 = { "record name",iocshArgString}; static const iocshArg dbelArg1 = { "level",iocshArgInt}; static const iocshArg * const dbelArgs[2] = {&dbelArg0,&dbelArg1}; -static const iocshFuncDef dbelFuncDef = {"dbel",2,dbelArgs}; +static const iocshFuncDef dbelFuncDef = {"dbel",2,dbelArgs, + "Database event list.\n" + "Show information on dbEvent subscriptions.\n"}; static void dbelCallFunc(const iocshArgBuf *args) { dbel(args[0].sval, args[1].ival); @@ -133,14 +149,18 @@ static void dbelCallFunc(const iocshArgBuf *args) /* dba */ static const iocshArg dbaArg0 = { "record name",iocshArgString}; static const iocshArg * const dbaArgs[1] = {&dbaArg0}; -static const iocshFuncDef dbaFuncDef = {"dba",1,dbaArgs}; +static const iocshFuncDef dbaFuncDef = {"dba",1,dbaArgs, + "dbAddr info.\n"}; static void dbaCallFunc(const iocshArgBuf *args) { dba(args[0].sval);} /* dbl */ static const iocshArg dblArg0 = { "record type",iocshArgString}; static const iocshArg dblArg1 = { "fields",iocshArgString}; static const iocshArg * const dblArgs[] = {&dblArg0,&dblArg1}; -static const iocshFuncDef dblFuncDef = {"dbl",2,dblArgs}; +static const iocshFuncDef dblFuncDef = {"dbl",2,dblArgs, + "Database list.\n" + "List record/field names.\n" + "With no arguments, lists all record names.\n"}; static void dblCallFunc(const iocshArgBuf *args) { dbl(args[0].sval,args[1].sval); @@ -149,38 +169,46 @@ static void dblCallFunc(const iocshArgBuf *args) /* dbnr */ static const iocshArg dbnrArg0 = { "verbose",iocshArgInt}; static const iocshArg * const dbnrArgs[1] = {&dbnrArg0}; -static const iocshFuncDef dbnrFuncDef = {"dbnr",1,dbnrArgs}; +static const iocshFuncDef dbnrFuncDef = {"dbnr",1,dbnrArgs, + "List stats on record alias()s.\n"}; static void dbnrCallFunc(const iocshArgBuf *args) { dbnr(args[0].ival);} /* dbli */ static const iocshArg dbliArg0 = { "pattern",iocshArgString}; static const iocshArg * const dbliArgs[1] = {&dbliArg0}; -static const iocshFuncDef dbliFuncDef = {"dbli",1,dbliArgs}; +static const iocshFuncDef dbliFuncDef = {"dbli",1,dbliArgs, + "List info() tags with names matching pattern.\n"}; static void dbliCallFunc(const iocshArgBuf *args) { dbli(args[0].sval);} /* dbla */ static const iocshArg dblaArg0 = { "pattern",iocshArgString}; static const iocshArg * const dblaArgs[1] = {&dblaArg0}; -static const iocshFuncDef dblaFuncDef = {"dbla",1,dblaArgs}; +static const iocshFuncDef dblaFuncDef = {"dbla",1,dblaArgs, + "List record alias()s by alias name pattern.\n"}; static void dblaCallFunc(const iocshArgBuf *args) { dbla(args[0].sval);} /* dbgrep */ static const iocshArg dbgrepArg0 = { "pattern",iocshArgString}; static const iocshArg * const dbgrepArgs[1] = {&dbgrepArg0}; -static const iocshFuncDef dbgrepFuncDef = {"dbgrep",1,dbgrepArgs}; +static const iocshFuncDef dbgrepFuncDef = {"dbgrep",1,dbgrepArgs, + "List record names matching pattern.\n"}; static void dbgrepCallFunc(const iocshArgBuf *args) { dbgrep(args[0].sval);} /* dbgf */ static const iocshArg dbgfArg0 = { "record name",iocshArgString}; static const iocshArg * const dbgfArgs[1] = {&dbgfArg0}; -static const iocshFuncDef dbgfFuncDef = {"dbgf",1,dbgfArgs}; +static const iocshFuncDef dbgfFuncDef = {"dbgf",1,dbgfArgs, + "Database Get Field.\n" + "Print current value of record field.\n"}; static void dbgfCallFunc(const iocshArgBuf *args) { dbgf(args[0].sval);} /* dbpf */ static const iocshArg dbpfArg0 = { "record name",iocshArgString}; static const iocshArg dbpfArg1 = { "value",iocshArgString}; static const iocshArg * const dbpfArgs[2] = {&dbpfArg0,&dbpfArg1}; -static const iocshFuncDef dbpfFuncDef = {"dbpf",2,dbpfArgs}; +static const iocshFuncDef dbpfFuncDef = {"dbpf",2,dbpfArgs, + "Database Put Field.\n" + "Change value of record field.\n"}; static void dbpfCallFunc(const iocshArgBuf *args) { dbpf(args[0].sval,args[1].sval);} @@ -188,27 +216,33 @@ static void dbpfCallFunc(const iocshArgBuf *args) static const iocshArg dbprArg0 = { "record name",iocshArgString}; static const iocshArg dbprArg1 = { "interest level",iocshArgInt}; static const iocshArg * const dbprArgs[2] = {&dbprArg0,&dbprArg1}; -static const iocshFuncDef dbprFuncDef = {"dbpr",2,dbprArgs}; +static const iocshFuncDef dbprFuncDef = {"dbpr",2,dbprArgs, + "Database Print Record.\n" + "Print values of record fields.\n"}; static void dbprCallFunc(const iocshArgBuf *args) { dbpr(args[0].sval,args[1].ival);} /* dbtr */ static const iocshArg dbtrArg0 = { "record name",iocshArgString}; static const iocshArg * const dbtrArgs[1] = {&dbtrArg0}; -static const iocshFuncDef dbtrFuncDef = {"dbtr",1,dbtrArgs}; +static const iocshFuncDef dbtrFuncDef = {"dbtr",1,dbtrArgs, + "Process record and then some fields.\n"}; static void dbtrCallFunc(const iocshArgBuf *args) { dbtr(args[0].sval);} /* dbtgf */ static const iocshArg dbtgfArg0 = { "record name",iocshArgString}; static const iocshArg * const dbtgfArgs[1] = {&dbtgfArg0}; -static const iocshFuncDef dbtgfFuncDef = {"dbtgf",1,dbtgfArgs}; +static const iocshFuncDef dbtgfFuncDef = {"dbtgf",1,dbtgfArgs, + "Database Test Get Field.\n" + "Get field with different DBR_* types"}; static void dbtgfCallFunc(const iocshArgBuf *args) { dbtgf(args[0].sval);} /* dbtpf */ static const iocshArg dbtpfArg0 = { "record name",iocshArgString}; static const iocshArg dbtpfArg1 = { "value",iocshArgString}; static const iocshArg * const dbtpfArgs[2] = {&dbtpfArg0,&dbtpfArg1}; -static const iocshFuncDef dbtpfFuncDef = {"dbtpf",2,dbtpfArgs}; +static const iocshFuncDef dbtpfFuncDef = {"dbtpf",2,dbtpfArgs, + "Database Test Put Field.\n"}; static void dbtpfCallFunc(const iocshArgBuf *args) { dbtpf(args[0].sval,args[1].sval);} @@ -216,25 +250,29 @@ static void dbtpfCallFunc(const iocshArgBuf *args) static const iocshArg dbiorArg0 = { "driver name",iocshArgString}; static const iocshArg dbiorArg1 = { "interest level",iocshArgInt}; static const iocshArg * const dbiorArgs[] = {&dbiorArg0,&dbiorArg1}; -static const iocshFuncDef dbiorFuncDef = {"dbior",2,dbiorArgs}; +static const iocshFuncDef dbiorFuncDef = {"dbior",2,dbiorArgs, + "Driver Report.\n"}; static void dbiorCallFunc(const iocshArgBuf *args) { dbior(args[0].sval,args[1].ival);} /* dbhcr */ -static const iocshFuncDef dbhcrFuncDef = {"dbhcr",0,0}; +static const iocshFuncDef dbhcrFuncDef = {"dbhcr",0,0, + "Database Report Device Config.\n"}; static void dbhcrCallFunc(const iocshArgBuf *args) { dbhcr();} /* gft */ static const iocshArg gftArg0 = { "record name",iocshArgString}; static const iocshArg * const gftArgs[1] = {&gftArg0}; -static const iocshFuncDef gftFuncDef = {"gft",1,gftArgs}; +static const iocshFuncDef gftFuncDef = {"gft",1,gftArgs, + "Report dbChannel info and value.\n"}; static void gftCallFunc(const iocshArgBuf *args) { gft(args[0].sval);} /* pft */ static const iocshArg pftArg0 = { "record name",iocshArgString}; static const iocshArg pftArg1 = { "value",iocshArgString}; static const iocshArg * const pftArgs[2] = {&pftArg0,&pftArg1}; -static const iocshFuncDef pftFuncDef = {"pft",2,pftArgs}; +static const iocshFuncDef pftFuncDef = {"pft",2,pftArgs, + "dbChannel put value.\n"}; static void pftCallFunc(const iocshArgBuf *args) { pft(args[0].sval,args[1].sval);} @@ -242,12 +280,16 @@ static void pftCallFunc(const iocshArgBuf *args) static const iocshArg dbtpnArg0 = { "record name",iocshArgString}; static const iocshArg dbtpnArg1 = { "value",iocshArgString}; static const iocshArg * const dbtpnArgs[2] = {&dbtpnArg0,&dbtpnArg1}; -static const iocshFuncDef dbtpnFuncDef = {"dbtpn",2,dbtpnArgs}; +static const iocshFuncDef dbtpnFuncDef = {"dbtpn",2,dbtpnArgs, + "Database Put Notify\n" + "Without value, begin async. processing and get\n" + "With value, begin put, process, and get"}; static void dbtpnCallFunc(const iocshArgBuf *args) { dbtpn(args[0].sval,args[1].sval);} /* dbNotifyDump */ -static const iocshFuncDef dbNotifyDumpFuncDef = {"dbNotifyDump",0,0}; +static const iocshFuncDef dbNotifyDumpFuncDef = {"dbNotifyDump",0,0, + "Report status of any active async processing with completion notification.\n"}; static void dbNotifyDumpCallFunc(const iocshArgBuf *args) { dbNotifyDump();} /* dbPutAttribute */ @@ -257,7 +299,8 @@ static const iocshArg dbPutAttrArg2 = { "value",iocshArgString}; static const iocshArg * const dbPutAttrArgs[] = {&dbPutAttrArg0, &dbPutAttrArg1, &dbPutAttrArg2}; static const iocshFuncDef dbPutAttrFuncDef = - {"dbPutAttribute",3,dbPutAttrArgs}; + {"dbPutAttribute",3,dbPutAttrArgs, + "Set/Create record attribute.\n"}; static void dbPutAttrCallFunc(const iocshArgBuf *args) { dbPutAttribute(args[0].sval,args[1].sval,args[2].sval);} @@ -265,7 +308,8 @@ static void dbPutAttrCallFunc(const iocshArgBuf *args) static const iocshArg tpnArg0 = { "record name",iocshArgString}; static const iocshArg tpnArg1 = { "value",iocshArgString}; static const iocshArg * const tpnArgs[2] = {&tpnArg0,&tpnArg1}; -static const iocshFuncDef tpnFuncDef = {"tpn",2,tpnArgs}; +static const iocshFuncDef tpnFuncDef = {"tpn",2,tpnArgs, + "Begin async. process and get.\n"}; static void tpnCallFunc(const iocshArgBuf *args) { tpn(args[0].sval,args[1].sval);} @@ -273,7 +317,8 @@ static void tpnCallFunc(const iocshArgBuf *args) static const iocshArg dblsrArg0 = { "record name",iocshArgString}; static const iocshArg dblsrArg1 = { "interest level",iocshArgInt}; static const iocshArg * const dblsrArgs[2] = {&dblsrArg0,&dblsrArg1}; -static const iocshFuncDef dblsrFuncDef = {"dblsr",2,dblsrArgs}; +static const iocshFuncDef dblsrFuncDef = {"dblsr",2,dblsrArgs, + "Database Lockset report.\n"}; static void dblsrCallFunc(const iocshArgBuf *args) { dblsr(args[0].sval,args[1].ival);} @@ -281,7 +326,8 @@ static void dblsrCallFunc(const iocshArgBuf *args) static const iocshArg dbLockShowLockedArg0 = { "interest level",iocshArgInt}; static const iocshArg * const dbLockShowLockedArgs[1] = {&dbLockShowLockedArg0}; static const iocshFuncDef dbLockShowLockedFuncDef = - {"dbLockShowLocked",1,dbLockShowLockedArgs}; + {"dbLockShowLocked",1,dbLockShowLockedArgs, + "Show Locksets which are currently locked.\n"}; static void dbLockShowLockedCallFunc(const iocshArgBuf *args) { dbLockShowLocked(args[0].ival);} @@ -290,7 +336,9 @@ static const iocshArg scanOnceSetQueueSizeArg0 = { "size",iocshArgInt}; static const iocshArg * const scanOnceSetQueueSizeArgs[1] = {&scanOnceSetQueueSizeArg0}; static const iocshFuncDef scanOnceSetQueueSizeFuncDef = - {"scanOnceSetQueueSize",1,scanOnceSetQueueSizeArgs}; + {"scanOnceSetQueueSize",1,scanOnceSetQueueSizeArgs, + "Change size of Scan once queue.\n" + "Must be called before iocInit().\n"}; static void scanOnceSetQueueSizeCallFunc(const iocshArgBuf *args) { scanOnceSetQueueSize(args[0].ival); @@ -301,7 +349,8 @@ static const iocshArg scanOnceQueueShowArg0 = { "reset",iocshArgInt}; static const iocshArg * const scanOnceQueueShowArgs[1] = {&scanOnceQueueShowArg0}; static const iocshFuncDef scanOnceQueueShowFuncDef = - {"scanOnceQueueShow",1,scanOnceQueueShowArgs}; + {"scanOnceQueueShow",1,scanOnceQueueShowArgs, + "Show details and statitics of scan once queue processing.\n"}; static void scanOnceQueueShowCallFunc(const iocshArgBuf *args) { scanOnceQueueShow(args[0].ival); @@ -310,21 +359,24 @@ static void scanOnceQueueShowCallFunc(const iocshArgBuf *args) /* scanppl */ static const iocshArg scanpplArg0 = { "rate",iocshArgDouble}; static const iocshArg * const scanpplArgs[1] = {&scanpplArg0}; -static const iocshFuncDef scanpplFuncDef = {"scanppl",1,scanpplArgs}; +static const iocshFuncDef scanpplFuncDef = {"scanppl",1,scanpplArgs, + "print periodic scan lists.\n"}; static void scanpplCallFunc(const iocshArgBuf *args) { scanppl(args[0].dval);} /* scanpel */ static const iocshArg scanpelArg0 = { "event name",iocshArgString}; static const iocshArg * const scanpelArgs[1] = {&scanpelArg0}; -static const iocshFuncDef scanpelFuncDef = {"scanpel",1,scanpelArgs}; +static const iocshFuncDef scanpelFuncDef = {"scanpel",1,scanpelArgs, + "Print info for records with SCAN = \"Event\".\n"}; static void scanpelCallFunc(const iocshArgBuf *args) { scanpel(args[0].sval);} /* postEvent */ static const iocshArg postEventArg0 = { "event name",iocshArgString}; static const iocshArg * const postEventArgs[1] = {&postEventArg0}; -static const iocshFuncDef postEventFuncDef = {"postEvent",1,postEventArgs}; +static const iocshFuncDef postEventFuncDef = {"postEvent",1,postEventArgs, + "Manually scan all records with EVNT == name.\n"}; static void postEventCallFunc(const iocshArgBuf *args) { EVENTPVT pel = eventNameToHandle(args[0].sval); @@ -332,7 +384,8 @@ static void postEventCallFunc(const iocshArgBuf *args) } /* scanpiol */ -static const iocshFuncDef scanpiolFuncDef = {"scanpiol",0}; +static const iocshFuncDef scanpiolFuncDef = {"scanpiol",0,0, + "Print info for records with SCAN = \"I/O Intr\".\n"}; static void scanpiolCallFunc(const iocshArgBuf *args) { scanpiol();} /* callbackSetQueueSize */ @@ -340,7 +393,9 @@ static const iocshArg callbackSetQueueSizeArg0 = { "bufsize",iocshArgInt}; static const iocshArg * const callbackSetQueueSizeArgs[1] = {&callbackSetQueueSizeArg0}; static const iocshFuncDef callbackSetQueueSizeFuncDef = - {"callbackSetQueueSize",1,callbackSetQueueSizeArgs}; + {"callbackSetQueueSize",1,callbackSetQueueSizeArgs, + "Change depth of queue for callback workers.\n" + "Must be called before iocInit().\n"}; static void callbackSetQueueSizeCallFunc(const iocshArgBuf *args) { callbackSetQueueSize(args[0].ival); @@ -351,7 +406,8 @@ static const iocshArg callbackQueueShowArg0 = { "reset", iocshArgInt}; static const iocshArg * const callbackQueueShowArgs[1] = {&callbackQueueShowArg0}; static const iocshFuncDef callbackQueueShowFuncDef = - {"callbackQueueShow",1,callbackQueueShowArgs}; + {"callbackQueueShow",1,callbackQueueShowArgs, + "Show status of callback thread processing queue.\n"}; static void callbackQueueShowCallFunc(const iocshArgBuf *args) { callbackQueueShow(args[0].ival); @@ -363,7 +419,10 @@ static const iocshArg callbackParallelThreadsArg1 = { "priority", iocshArgString static const iocshArg * const callbackParallelThreadsArgs[2] = {&callbackParallelThreadsArg0,&callbackParallelThreadsArg1}; static const iocshFuncDef callbackParallelThreadsFuncDef = - {"callbackParallelThreads",2,callbackParallelThreadsArgs}; + {"callbackParallelThreads",2,callbackParallelThreadsArgs, + "Configure multiple workers for a given callback queue priority level.\n" + "priority may be omitted or \"*\" to act on all priorities\n" + "or one of LOW, MEDIUM, or HIGH.\n"}; static void callbackParallelThreadsCallFunc(const iocshArgBuf *args) { callbackParallelThreads(args[0].ival, args[1].sval); @@ -372,7 +431,8 @@ static void callbackParallelThreadsCallFunc(const iocshArgBuf *args) /* dbStateCreate */ static const iocshArg dbStateArgName = { "name", iocshArgString }; static const iocshArg * const dbStateCreateArgs[] = { &dbStateArgName }; -static const iocshFuncDef dbStateCreateFuncDef = { "dbStateCreate", 1, dbStateCreateArgs }; +static const iocshFuncDef dbStateCreateFuncDef = { "dbStateCreate", 1, dbStateCreateArgs, + "Allocate new state name for \"state\" filter.\n"}; static void dbStateCreateCallFunc (const iocshArgBuf *args) { dbStateCreate(args[0].sval); @@ -380,7 +440,8 @@ static void dbStateCreateCallFunc (const iocshArgBuf *args) /* dbStateSet */ static const iocshArg * const dbStateSetArgs[] = { &dbStateArgName }; -static const iocshFuncDef dbStateSetFuncDef = { "dbStateSet", 1, dbStateSetArgs }; +static const iocshFuncDef dbStateSetFuncDef = { "dbStateSet", 1, dbStateSetArgs, + "Change state to set for \"state\" filter.\n"}; static void dbStateSetCallFunc (const iocshArgBuf *args) { dbStateId sid = dbStateFind(args[0].sval); @@ -391,7 +452,8 @@ static void dbStateSetCallFunc (const iocshArgBuf *args) /* dbStateClear */ static const iocshArg * const dbStateClearArgs[] = { &dbStateArgName }; -static const iocshFuncDef dbStateClearFuncDef = { "dbStateClear", 1, dbStateClearArgs }; +static const iocshFuncDef dbStateClearFuncDef = { "dbStateClear", 1, dbStateClearArgs, + "Change state to clear for \"state\" filter.\n" }; static void dbStateClearCallFunc (const iocshArgBuf *args) { dbStateId sid = dbStateFind(args[0].sval); @@ -403,7 +465,8 @@ static void dbStateClearCallFunc (const iocshArgBuf *args) /* dbStateShow */ static const iocshArg dbStateShowArg1 = { "level", iocshArgInt }; static const iocshArg * const dbStateShowArgs[] = { &dbStateArgName, &dbStateShowArg1 }; -static const iocshFuncDef dbStateShowFuncDef = { "dbStateShow", 2, dbStateShowArgs }; +static const iocshFuncDef dbStateShowFuncDef = { "dbStateShow", 2, dbStateShowArgs, + "Show set/clear status of named state. (cf. \"state\" filter)\n" }; static void dbStateShowCallFunc (const iocshArgBuf *args) { dbStateId sid = dbStateFind(args[0].sval); @@ -415,7 +478,8 @@ static void dbStateShowCallFunc (const iocshArgBuf *args) /* dbStateShowAll */ static const iocshArg dbStateShowAllArg0 = { "level", iocshArgInt }; static const iocshArg * const dbStateShowAllArgs[] = { &dbStateShowAllArg0 }; -static const iocshFuncDef dbStateShowAllFuncDef = { "dbStateShowAll", 1, dbStateShowAllArgs }; +static const iocshFuncDef dbStateShowAllFuncDef = { "dbStateShowAll", 1, dbStateShowAllArgs, + "Show set/clear status of all named states. (cf. \"state\" filter)\n" }; static void dbStateShowAllCallFunc (const iocshArgBuf *args) { dbStateShowAll(args[0].ival); diff --git a/modules/database/src/ioc/dbStatic/dbStaticIocRegister.c b/modules/database/src/ioc/dbStatic/dbStaticIocRegister.c index 65acc198d8..d7c02b6e09 100644 --- a/modules/database/src/ioc/dbStatic/dbStaticIocRegister.c +++ b/modules/database/src/ioc/dbStatic/dbStaticIocRegister.c @@ -22,7 +22,8 @@ static const iocshArg argRecType = { "recordTypeName", iocshArgString}; /* dbDumpPath */ static const iocshArg * const dbDumpPathArgs[] = {&argPdbbase}; -static const iocshFuncDef dbDumpPathFuncDef = {"dbDumpPath",1,dbDumpPathArgs}; +static const iocshFuncDef dbDumpPathFuncDef = {"dbDumpPath",1,dbDumpPathArgs, + "Dump .db/.dbd file search path.\n"}; static void dbDumpPathCallFunc(const iocshArgBuf *args) { dbDumpPath(*iocshPpdbbase); diff --git a/modules/libcom/src/iocsh/iocsh.cpp b/modules/libcom/src/iocsh/iocsh.cpp index 97d1101f6a..0492156e7d 100644 --- a/modules/libcom/src/iocsh/iocsh.cpp +++ b/modules/libcom/src/iocsh/iocsh.cpp @@ -442,7 +442,10 @@ stopRedirect(const char *filename, int lineno, struct iocshRedirect *redirect) static const iocshArg helpArg0 = { "[command ...]",iocshArgArgv}; static const iocshArg *helpArgs[1] = {&helpArg0}; static const iocshFuncDef helpFuncDef = - {"help",1,helpArgs}; + {"help",1,helpArgs, + "With no arguments, list available command names.\n" + "With arguments, list arguments and usage for command(s).\n" + "Command names may contain wildcards\n"}; static void helpCallFunc(const iocshArgBuf *args) { int argc = args[0].aval.ac; @@ -485,6 +488,9 @@ static void helpCallFunc(const iocshArgBuf *args) for (pcmd = iocshCommandHead ; pcmd != NULL ; pcmd = pcmd->next) { piocshFuncDef = pcmd->def.pFuncDef; if (epicsStrGlobMatch(piocshFuncDef->name, argv[iarg]) != 0) { + if(piocshFuncDef->usage) { + fputs("\nUsage: ", epicsGetStdout()); + } fputs(piocshFuncDef->name, epicsGetStdout()); for (int a = 0 ; a < piocshFuncDef->nargs ; a++) { const char *cp = piocshFuncDef->arg[a]->name; @@ -497,6 +503,9 @@ static void helpCallFunc(const iocshArgBuf *args) } } fprintf(epicsGetStdout(),"\n");; + if(piocshFuncDef->usage) { + fprintf(epicsGetStdout(), "\n%s", piocshFuncDef->usage); + } } } } @@ -1159,7 +1168,12 @@ static void iocshRunCallFunc(const iocshArgBuf *args) /* on */ static const iocshArg onArg0 = { "'error' 'continue' | 'break' | 'wait' [value] | 'halt'", iocshArgArgv }; static const iocshArg *onArgs[1] = {&onArg0}; -static const iocshFuncDef onFuncDef = {"on", 1, onArgs}; +static const iocshFuncDef onFuncDef = {"on", 1, onArgs, + "Change IOC shell error handling.\n" + " continue (default) - Ignores error and continue with next commands.\n" + " break - Return to caller without executing futher commands.\n" + " halt - Suspend process.\n" + " wait - stall process for [value] seconds, the continue.\n"}; static void onCallFunc(const iocshArgBuf *args) { iocshContext *context = (iocshContext *) epicsThreadPrivateGet(iocshContextId); @@ -1225,7 +1239,8 @@ static void commentCallFunc(const iocshArgBuf *) /* exit */ static const iocshFuncDef exitFuncDef = - {"exit",0,0}; + {"exit",0,0, + "Return to caller. IOCs exit() from process.\n"}; static void exitCallFunc(const iocshArgBuf *) { } diff --git a/modules/libcom/src/iocsh/iocsh.h b/modules/libcom/src/iocsh/iocsh.h index a63af64ceb..4b87f3dd70 100644 --- a/modules/libcom/src/iocsh/iocsh.h +++ b/modules/libcom/src/iocsh/iocsh.h @@ -62,6 +62,7 @@ typedef struct iocshFuncDef { const char *name; int nargs; const iocshArg * const *arg; + const char* usage; }iocshFuncDef; typedef void (*iocshCallFunc)(const iocshArgBuf *argBuf);