Command line options and help fixes Signed-off-by: Alain Dargelas <alainmarcel@yahoo.com>
diff --git a/src/CommandLine/CommandLineParser.cpp b/src/CommandLine/CommandLineParser.cpp index e64a826..ab0af8c 100644 --- a/src/CommandLine/CommandLineParser.cpp +++ b/src/CommandLine/CommandLineParser.cpp
@@ -66,7 +66,7 @@ " -f <file> Accepts a file containing command line arguments", " -v <file> Library file", " -y <path> Library directory", - " +incdir+<dir>+... Specifies include paths", + " +incdir+<dir>[+<dir>...] Specifies include paths", " -Idir Specifies include paths", " +libext+<extname>+... Specifies the library extensions", " <file>.v Verilog File", @@ -75,7 +75,7 @@ " +librescan Lib Rescan option (ignored)", " +libverbose Lib Verbose option (ignored)", " +nolibcell No Lib Cell option (ignored)", - " +define+macro_name=definition+...", + " +define+<name>=<value>[+<name>=<value>...]", " Defines a macro and optionally its value", " -L <libName> Defines library compilation order", " -map <mapFile> Specifies a library mapping file (multiple -map " @@ -146,7 +146,10 @@ " -nonote Filters out NOTE messages", " -nowarning Filters out WARNING messages", " -o <path> Turns on all compilation stages, produces all " - "outputs under that path"}; + "outputs under that path", + " --help This help", + " --version Surelog version" +}; std::string printStringArray(const std::vector<std::string>& array) { std::string report; @@ -174,7 +177,7 @@ std::string copyrights = printStringArray(copyright); m_errors->printToLogFile(banners); m_errors->printToLogFile(copyrights); - std::string version = "VERSION: " + m_versionNumber + +"\n" + + std::string version = "VERSION: " + m_versionNumber +"\n" + "BUILT : " + std::string(__DATE__) + "\n"; std::string date = "DATE : " + currentDateTime() + "\n"; std::string cmd = "COMMAND:"; @@ -187,17 +190,6 @@ m_errors->printToLogFile(cmd); } -void CommandLineParser::printBanner() { - std::string banners = printStringArray(banner); - std::cout << banners; -} - -void CommandLineParser::printFooter() { - std::string footers = "\n"; - footers += printStringArray(footer); - std::cout << footers; -} - void CommandLineParser::logFooter() { std::string footers = "\n"; footers += printStringArray(footer); @@ -396,14 +388,20 @@ } processArgs_(cmd_line, all_arguments); for (unsigned int i = 0; i < all_arguments.size(); i++) { - if (all_arguments[i] == "-help" || all_arguments[i] == "-h") { + if (all_arguments[i] == "-help" || all_arguments[i] == "-h" || + all_arguments[i] == "--help") { m_help = true; std::string help = printStringArray(helpText); m_errors->init(); logBanner(argc, argv); - printBanner(); std::cout << help; - m_errors->printToLogFile(help); + return true; + } + if (all_arguments[i] == "--version") { + std::string version = "VERSION: " + m_versionNumber +"\n" + + "BUILT : " + std::string(__DATE__) + "\n"; + std::cout << version << std::flush; + m_help = true; return true; } if (all_arguments[i] == "-nobuiltin") { @@ -830,9 +828,6 @@ m_errors->init(); logBanner(argc, argv); - if (!m_muteStdout) { - printBanner(); - } Location loc(m_logFileId); Error err(ErrorDefinition::CMD_CREATING_LOG_FILE, loc); m_errors->addError(err);
diff --git a/src/CommandLine/CommandLineParser.hpp b/src/CommandLine/CommandLineParser.hpp index 0704410..7121567 100644 --- a/src/CommandLine/CommandLineParser.hpp +++ b/src/CommandLine/CommandLineParser.hpp
@@ -89,14 +89,12 @@ bool muteStdout() { return m_muteStdout; } bool verbose() { return m_verbose; } bool profile() { return m_profile; } - int getDebugLevel() { return m_debugLevel; } + int getDebugLevel() { return m_debugLevel; } bool getDebugAstModel() { return m_debugAstModel; } bool getDebugInstanceTree() { return m_debugInstanceTree; } bool getDebugLibraryDef() { return m_debugLibraryDef; } bool getDebugIncludeFileInfo() { return m_debugIncludeFileInfo; } bool help() { return m_help; } - void printBanner(); - void printFooter(); void logBanner(int argc, const char** argv); void logFooter(); static std::string getVersionNumber() { return m_versionNumber; }
diff --git a/src/ErrorReporting/Report.cpp b/src/ErrorReporting/Report.cpp index 8d71757..6470ddf 100644 --- a/src/ErrorReporting/Report.cpp +++ b/src/ErrorReporting/Report.cpp
@@ -104,8 +104,6 @@ } } - clp->printBanner(); - std::cout << "|-------|------------------|-------------------|" << std::endl; std::cout << "| | FILE UNIT COMP | ALL COMPILATION |" << std::endl; std::cout << "|-------|------------------|-------------------|" << std::endl; @@ -154,7 +152,6 @@ } } - clp->printFooter(); int nbFatal = atoi(readUnitResult.m_nbFatal.c_str()) + atoi(readAllResult.m_nbFatal.c_str()); // m.unlock();
diff --git a/src/main.cpp b/src/main.cpp index 2cb5e10..7856bf7 100644 --- a/src/main.cpp +++ b/src/main.cpp
@@ -65,8 +65,6 @@ { noFatalErrors = false; } - if (!clp->muteStdout ()) - clp->printFooter (); clp->logFooter(); if (diff_comp_mode && fileunit) {