summaryrefslogtreecommitdiffstats
path: root/src/base/main/mainReal.c
diff options
context:
space:
mode:
authorBaruch Sterin <baruchs@gmail.com>2015-11-18 16:32:39 -0800
committerBaruch Sterin <baruchs@gmail.com>2015-11-18 16:32:39 -0800
commit5df0cf98e619d64d110e17ab4e31a986257f47a6 (patch)
tree9de1578654b050ed68314d12acdd458b3eb4bd03 /src/base/main/mainReal.c
parent2ac47fe5849ccacdf698406b2732505e6e1905c0 (diff)
downloadabc-5df0cf98e619d64d110e17ab4e31a986257f47a6.tar.gz
abc-5df0cf98e619d64d110e17ab4e31a986257f47a6.tar.bz2
abc-5df0cf98e619d64d110e17ab4e31a986257f47a6.zip
main: add option -Q for execute command quietly, then interactive
Diffstat (limited to 'src/base/main/mainReal.c')
-rw-r--r--src/base/main/mainReal.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/base/main/mainReal.c b/src/base/main/mainReal.c
index a26cfa84..ee43d38d 100644
--- a/src/base/main/mainReal.c
+++ b/src/base/main/mainReal.c
@@ -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
-