Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
a6bfd495
Commit
a6bfd495
authored
Aug 27, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved printout of command history.
parent
da683846
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
2 deletions
+31
-2
src/base/cmd/cmd.h
+1
-0
src/base/cmd/cmdHist.c
+26
-1
src/base/cmd/cmdPlugin.c
+1
-1
src/base/main/main.c
+3
-0
No files found.
src/base/cmd/cmd.h
View file @
a6bfd495
...
...
@@ -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
);
...
...
src/base/cmd/cmdHist.c
View file @
a6bfd495
...
...
@@ -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 ///
////////////////////////////////////////////////////////////////////////
...
...
src/base/cmd/cmdPlugin.c
View file @
a6bfd495
...
...
@@ -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
);
...
...
src/base/main/main.c
View file @
a6bfd495
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment