Commit a6bfd495 by Alan Mishchenko

Improved printout of command history.

parent da683846
......@@ -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 );
......
......@@ -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 ///
////////////////////////////////////////////////////////////////////////
......
......@@ -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 );
......
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment