MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / CmdHelpSpecific

Function CmdHelpSpecific

source/Debugger/Debugger_Help.cpp:468–1432  ·  view source on GitHub ↗

Help on specific command ===========================================================================

Source from the content-addressed store, hash-verified

466// Help on specific command
467//===========================================================================
468Update_t CmdHelpSpecific (int nArgs)
469{
470 int iArg;
471
472 if (! nArgs)
473 {
474 Help_Categories();
475 return ConsoleUpdate();
476 }
477
478 CmdFuncPtr_t pFunction = NULL;
479 bool bAllCommands = false;
480 bool bCategory = false;
481 bool bDisplayCategory = true;
482
483 if ((! strcmp( g_aArgs[1].sArg, g_aParameters[ PARAM_WILDSTAR ].m_sName)) ||
484 (! strcmp( g_aArgs[1].sArg, g_aParameters[ PARAM_MEM_SEARCH_WILD ].m_sName)) )
485 {
486 bAllCommands = true;
487 nArgs = NUM_COMMANDS;
488 }
489
490 // If Help on category, push command name as arg
491 // Mame has categories:
492 // General, Memory, Execution, Breakpoints, Watchpoints, Expressions, Comments
493 int iParam = 0;
494
495 int nNewArgs = 0;
496 int iCmdBegin = 0;
497 int iCmdEnd = 0;
498 int nFound = 0;
499 int iCommand = 0;
500
501 if (! bAllCommands)
502 {
503 for (iArg = 1; iArg <= nArgs; iArg++ )
504 {
505 // int nFoundCategory = FindParam( g_aArgs[ iArg ].sArg, MATCH_EXACT, iParam, _PARAM_HELPCATEGORIES_BEGIN, _PARAM_HELPCATEGORIES_END );
506 int nFoundCategory = FindParam( g_aArgs[ iArg ].sArg, MATCH_FUZZY, iParam, _PARAM_HELPCATEGORIES_BEGIN, _PARAM_HELPCATEGORIES_END );
507 if ( nFoundCategory )
508 bCategory = true;
509 else
510 bCategory = false;
511 switch ( iParam )
512 {
513 case PARAM_CAT_BOOKMARKS : iCmdBegin = CMD_BOOKMARK ; iCmdEnd = CMD_BOOKMARK_SAVE ; break;
514 case PARAM_CAT_BREAKPOINTS: iCmdBegin = CMD_BREAK_INVALID ; iCmdEnd = CMD_BREAKPOINT_CHANGE ; break;
515 case PARAM_CAT_CONFIG : iCmdBegin = CMD_BENCHMARK ; iCmdEnd = CMD_CONFIG_SET_DEBUG_DIR; break;
516 case PARAM_CAT_CPU : iCmdBegin = CMD_ASSEMBLE ; iCmdEnd = CMD_UNASSEMBLE ; break;
517 case PARAM_CAT_FLAGS :
518 nFound = FindCommand( g_aArgs[iArg].sArg, pFunction, & iCommand ); // check if we have an exact command match first
519 if ( nFound ) // && (iCommand != CMD_MEMORY_FILL))
520 bCategory = false;
521 else if ( nFoundCategory )
522 {
523 iCmdBegin = CMD_FLAG_CLEAR ; iCmdEnd = CMD_FLAG_SET_N;
524 }
525 break;

Callers 1

Help_Arg_1Function · 0.85

Calls 15

Help_CategoriesFunction · 0.85
FindParamFunction · 0.85
FindCommandFunction · 0.85
Help_KeyboardShortcutsFunction · 0.85
Help_OperatorsFunction · 0.85
Help_RangeFunction · 0.85
DisplayAmbigiousCommandsFunction · 0.85
ConsolePrintFormatFunction · 0.85
StrFormatFunction · 0.85
ConsolePrintFunction · 0.85
ConsoleBufferPushFormatFunction · 0.85
ConsoleColorizePrintFunction · 0.85

Tested by

no test coverage detected