From: Andres Noetzli Date: Thu, 19 Aug 2021 23:03:13 +0000 (-0700) Subject: Remove `--(no-)interactive-prompt` (#7022) X-Git-Tag: cvc5-1.0.0~1365 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=51a4feb8f775087fc0a4080978f98346574de50b;p=cvc5.git Remove `--(no-)interactive-prompt` (#7022) This option is mostly redundant: It offers a way to access the interactive shell without any copyright information or cvc5> prompt being printed. However, --no-interactive offers the same experience (except for the features offered by libedit). --- diff --git a/src/main/driver_unified.cpp b/src/main/driver_unified.cpp index 8c86f03cb..606f18095 100644 --- a/src/main/driver_unified.cpp +++ b/src/main/driver_unified.cpp @@ -148,9 +148,7 @@ int runCvc5(int argc, char* argv[], Options& opts) // Auto-detect input language by filename extension std::string filenameStr(""); if (!inputFromStdin) { - // Use swap to avoid copying the string - // TODO: use std::move() when switching to c++11 - filenameStr.swap(filenames[0]); + filenameStr = std::move(filenames[0]); } const char* filename = filenameStr.c_str(); @@ -217,20 +215,19 @@ int runCvc5(int argc, char* argv[], Options& opts) } InteractiveShell shell(pExecutor->getSolver(), pExecutor->getSymbolManager()); - if (opts.driver.interactivePrompt) + + CVC5Message() << Configuration::getPackageName() << " " + << Configuration::getVersionString(); + if (Configuration::isGitBuild()) { - CVC5Message() << Configuration::getPackageName() << " " - << Configuration::getVersionString(); - if(Configuration::isGitBuild()) { - CVC5Message() << " [" << Configuration::getGitId() << "]"; - } - CVC5Message() << (Configuration::isDebugBuild() ? " DEBUG" : "") - << " assertions:" - << (Configuration::isAssertionBuild() ? "on" : "off") - << endl - << endl; - CVC5Message() << Configuration::copyright() << endl; + CVC5Message() << " [" << Configuration::getGitId() << "]"; } + CVC5Message() << (Configuration::isDebugBuild() ? " DEBUG" : "") + << " assertions:" + << (Configuration::isAssertionBuild() ? "on" : "off") + << endl + << endl; + CVC5Message() << Configuration::copyright() << endl; while(true) { try { diff --git a/src/main/interactive_shell.cpp b/src/main/interactive_shell.cpp index 763692d07..7a1ee89ab 100644 --- a/src/main/interactive_shell.cpp +++ b/src/main/interactive_shell.cpp @@ -205,9 +205,7 @@ restart: if (d_usingEditline) { #if HAVE_LIBEDITLINE - lineBuf = ::readline(d_options.driver.interactivePrompt - ? (line == "" ? "cvc5> " : "... > ") - : ""); + lineBuf = ::readline(line == "" ? "cvc5> " : "... > "); if(lineBuf != NULL && lineBuf[0] != '\0') { ::add_history(lineBuf); } @@ -217,13 +215,13 @@ restart: } else { - if (d_options.driver.interactivePrompt) + if (line == "") { - if(line == "") { - d_out << "cvc5> " << flush; - } else { - d_out << "... > " << flush; - } + d_out << "cvc5> " << flush; + } + else + { + d_out << "... > " << flush; } /* Read a line */ @@ -291,8 +289,7 @@ restart: if (d_usingEditline) { #if HAVE_LIBEDITLINE - lineBuf = ::readline(d_options.driver.interactivePrompt ? "... > " - : ""); + lineBuf = ::readline("... > "); if(lineBuf != NULL && lineBuf[0] != '\0') { ::add_history(lineBuf); } @@ -302,10 +299,7 @@ restart: } else { - if (d_options.driver.interactivePrompt) - { - d_out << "... > " << flush; - } + d_out << "... > " << flush; /* Read a line */ stringbuf sb; diff --git a/src/options/main_options.toml b/src/options/main_options.toml index 869d411bd..55f74f50c 100644 --- a/src/options/main_options.toml +++ b/src/options/main_options.toml @@ -70,15 +70,7 @@ public = true category = "regular" long = "interactive" type = "bool" - help = "force interactive/non-interactive mode" - -[[option]] - name = "interactivePrompt" - category = "undocumented" - long = "interactive-prompt" - type = "bool" - default = "true" - help = "interactive prompting while in interactive mode" + help = "force interactive shell/non-interactive mode" [[option]] name = "segvSpin"