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
5df0cf98
Commit
5df0cf98
authored
Nov 18, 2015
by
Baruch Sterin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
main: add option -Q for execute command quietly, then interactive
parent
2ac47fe5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
src/base/main/mainReal.c
+13
-5
src/base/main/mainUtils.c
+2
-2
No files found.
src/base/main/mainReal.c
View file @
5df0cf98
...
...
@@ -89,6 +89,7 @@ int Abc_RealMain( int argc, char * argv[] )
BATCH
,
// batch mode, run a command and quit
BATCH_THEN_INTERACTIVE
,
// run a command, then back to interactive mode
BATCH_QUIET
,
// as in batch mode, but don't echo the command
BATCH_QUIET_THEN_INTERACTIVE
,
// as in batch then interactive mode, but don't echo the command
BATCH_SMT
// special batch mode, which expends SMTLIB problem via stdin
}
fBatch
;
...
...
@@ -114,7 +115,7 @@ int Abc_RealMain( int argc, char * argv[] )
sprintf
(
sWriteCmd
,
"write"
);
Extra_UtilGetoptReset
();
while
((
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"c:q:C:S:hf:F:o:st:T:xb"
))
!=
EOF
)
{
while
((
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"c:q:C:
Q:
S:hf:F:o:st:T:xb"
))
!=
EOF
)
{
switch
(
c
)
{
case
'c'
:
if
(
Vec_StrSize
(
sCommandUsr
)
>
0
)
...
...
@@ -134,6 +135,15 @@ int Abc_RealMain( int argc, char * argv[] )
fBatch
=
BATCH_QUIET
;
break
;
case
'Q'
:
if
(
Vec_StrSize
(
sCommandUsr
)
>
0
)
{
Vec_StrAppend
(
sCommandUsr
,
" ; "
);
}
Vec_StrAppend
(
sCommandUsr
,
globalUtilOptarg
);
fBatch
=
BATCH_QUIET_THEN_INTERACTIVE
;
break
;
case
'C'
:
if
(
Vec_StrSize
(
sCommandUsr
)
>
0
)
{
...
...
@@ -242,14 +252,13 @@ int Abc_RealMain( int argc, char * argv[] )
extern
Gia_Man_t
*
Gia_ManFromBridge
(
FILE
*
pFile
,
Vec_Int_t
**
pvInit
);
pAbc
->
pGia
=
Gia_ManFromBridge
(
stdin
,
NULL
);
}
else
if
(
fBatch
!=
INTERACTIVE
&&
fBatch
!=
BATCH_QUIET
&&
Vec_StrSize
(
sCommandUsr
)
>
0
)
else
if
(
fBatch
!=
INTERACTIVE
&&
fBatch
!=
BATCH_QUIET
&&
fBatch
!=
BATCH_QUIET_THEN_INTERACTIVE
&&
Vec_StrSize
(
sCommandUsr
)
>
0
)
Abc_Print
(
1
,
"ABC command line:
\"
%s
\"
.
\n\n
"
,
Vec_StrArray
(
sCommandUsr
)
);
if
(
fBatch
!=
INTERACTIVE
)
{
pAbc
->
fBatchMode
=
1
;
if
(
argc
-
globalUtilOptind
==
0
)
{
sInFile
=
NULL
;
...
...
@@ -288,7 +297,7 @@ int Abc_RealMain( int argc, char * argv[] )
}
}
if
(
fBatch
==
BATCH_THEN_INTERACTIVE
){
if
(
fBatch
==
BATCH_THEN_INTERACTIVE
||
fBatch
==
BATCH_QUIET_THEN_INTERACTIVE
){
fBatch
=
INTERACTIVE
;
pAbc
->
fBatchMode
=
0
;
}
...
...
@@ -375,4 +384,3 @@ static int TypeCheck( Abc_Frame_t * pAbc, const char * s )
ABC_NAMESPACE_IMPL_END
src/base/main/mainUtils.c
View file @
5df0cf98
...
...
@@ -121,11 +121,12 @@ void Abc_UtilsPrintUsage( Abc_Frame_t * pAbc, char * ProgName )
{
fprintf
(
pAbc
->
Err
,
"
\n
"
);
fprintf
(
pAbc
->
Err
,
"usage: %s [-c cmd] [-
f script] [-h] [-o file] [-s] [-t type] [-T type] [-x] [-b] [file]
\n
"
,
"usage: %s [-c cmd] [-
q cmd] [-C cmd] [-Q cmd] [-f script] [-h] [-o file] [-s] [-t type] [-T type] [-x] [-b] [file]
\n
"
,
ProgName
);
fprintf
(
pAbc
->
Err
,
" -c cmd
\t
execute commands `cmd'
\n
"
);
fprintf
(
pAbc
->
Err
,
" -q cmd
\t
execute commands `cmd' quietly
\n
"
);
fprintf
(
pAbc
->
Err
,
" -C cmd
\t
execute commands `cmd', then continue in interactive mode
\n
"
);
fprintf
(
pAbc
->
Err
,
" -Q cmd
\t
execute commands `cmd' quietly, then continue in interactive mode
\n
"
);
fprintf
(
pAbc
->
Err
,
" -F script
\t
execute commands from a script file and echo commands
\n
"
);
fprintf
(
pAbc
->
Err
,
" -f script
\t
execute commands from a script file
\n
"
);
fprintf
(
pAbc
->
Err
,
" -h
\t\t
print the command usage
\n
"
);
...
...
@@ -291,4 +292,3 @@ char * DateReadFromDateString( char * datestr )
ABC_NAMESPACE_IMPL_END
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