diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/base/cmd/cmd.h | 1 | ||||
-rw-r--r-- | src/base/cmd/cmdHist.c | 27 | ||||
-rw-r--r-- | src/base/cmd/cmdPlugin.c | 2 | ||||
-rw-r--r-- | src/base/main/main.c | 3 |
4 files changed, 31 insertions, 2 deletions
diff --git a/src/base/cmd/cmd.h b/src/base/cmd/cmd.h index fc16581f..55cad6e5 100644 --- a/src/base/cmd/cmd.h +++ b/src/base/cmd/cmd.h @@ -62,6 +62,7 @@ extern void Cmd_FlagUpdateValue( Abc_Frame_t * pAbc, const char * key, ch extern void Cmd_HistoryAddCommand( Abc_Frame_t * pAbc, const char * command ); extern void Cmd_HistoryRead( Abc_Frame_t * p ); extern void Cmd_HistoryWrite( Abc_Frame_t * p, int Limit ); +extern void Cmd_HistoryPrint( Abc_Frame_t * p, int Limit ); /*=== cmdLoad.c ========================================================*/ extern int CmdCommandLoad( Abc_Frame_t * pAbc, int argc, char ** argv ); diff --git a/src/base/cmd/cmdHist.c b/src/base/cmd/cmdHist.c index 4aa8105b..27a3e61e 100644 --- a/src/base/cmd/cmdHist.c +++ b/src/base/cmd/cmdHist.c @@ -55,7 +55,8 @@ void Cmd_HistoryAddCommand( Abc_Frame_t * p, const char * command ) strcpy( Buffer, command ); if ( Buffer[Len-1] == '\n' ) Buffer[Len-1] = 0; - if ( strncmp(Buffer,"set",3) && + if ( strlen(Buffer) > 3 && + strncmp(Buffer,"set",3) && strncmp(Buffer,"quit",4) && strncmp(Buffer,"source",6) && strncmp(Buffer,"history",7) && strncmp(Buffer,"hi ", 3) && strcmp(Buffer,"hi") ) @@ -140,6 +141,30 @@ void Cmd_HistoryWrite( Abc_Frame_t * p, int Limit ) #endif } +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Cmd_HistoryPrint( Abc_Frame_t * p, int Limit ) +{ +#if defined(WIN32) + char * pStr; + int i; + Limit = Abc_MaxInt( 0, Vec_PtrSize(p->aHistory)-Limit ); + printf( "================== Command history ==================\n" ); + Vec_PtrForEachEntryStart( char *, p->aHistory, pStr, i, Limit ) + printf( "%s\n", pStr ); + printf( "=====================================================\n" ); +#endif +} + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// diff --git a/src/base/cmd/cmdPlugin.c b/src/base/cmd/cmdPlugin.c index 118fc95a..93eee5b8 100644 --- a/src/base/cmd/cmdPlugin.c +++ b/src/base/cmd/cmdPlugin.c @@ -709,7 +709,7 @@ int Cmd_CommandAbcLoadPlugIn( Abc_Frame_t * pAbc, int argc, char ** argv ) // plugin_commands.push(Pair(cmd_name, binary_name)); Vec_PtrPush( pAbc->vPlugInComBinPairs, Extra_UtilStrsav(pBuffer) ); Vec_PtrPush( pAbc->vPlugInComBinPairs, Extra_UtilStrsav(pStrDirBin) ); - printf( "Creating command %s with binary %s\n", pBuffer, pStrDirBin ); +// printf( "Creating command %s with binary %s\n", pBuffer, pStrDirBin ); } fclose( pFile ); Util_SignalTmpFileRemove( pTempFile, 0 ); diff --git a/src/base/main/main.c b/src/base/main/main.c index 82ed3def..80d81c28 100644 --- a/src/base/main/main.c +++ b/src/base/main/main.c @@ -268,8 +268,11 @@ int Abc_RealMain( int argc, char * argv[] ) else { // start interactive mode + // print the hello line Abc_UtilsPrintHello( pAbc ); + // print history of the recent commands + Cmd_HistoryPrint( pAbc, 10 ); // source the resource file if ( fInitSource ) |