Changeset 724 for trunk/lib


Ignore:
Timestamp:
Dec 9, 2008, 2:34:16 PM (13 years ago)
Author:
Peter Johansson
Message:
  • README.developer: adding text on Requirements for building from svn checkout
  • configure.ac: support for help2man and new man/Makefile
  • lib/OptionVersion.cc lib/OptionVersion.h bin/Parameter.cc: changed --version output so when used in combination with --no-verbose it is compliant with help2man
  • lib/utility.cc: removed function version_string not used anymore

closes #361

Location:
trunk/lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/OptionVersion.cc

    r705 r724  
    3535
    3636  OptionVersion::OptionVersion(CommandLine& cmd, std::string flag,
    37                                std::string desc)
    38     : OptionSwitch(cmd, flag, desc, false)
     37                               std::string desc, OptionSwitch* const verbose)
     38    : OptionSwitch(cmd, flag, desc, false), verbose_(verbose)
    3939  {
    4040  }
     
    4646    ColumnStream cs(std::cout, 1);
    4747    cs.width(0)=79;
    48     cs << PACKAGE_NAME << " " << PACKAGE_VERSION << version_string() << "\n";
    49     cs << "\nCopyright (C) " << svn_year()
     48    cs << PACKAGE_NAME << " " << PACKAGE_VERSION;
     49    bool no_verbose = verbose_ && verbose_->present() && !verbose_->value();
     50    if (!no_verbose) {
     51      cs << " (";
     52      if (DEV_BUILD)
     53        cs << "r" << svn_revision() << " ";
     54      cs << "compiled " << compilation_time() << ", " << compilation_date()
     55         << ")";
     56    }
     57    cs << "\n\nCopyright (C) " << svn_year()
    5058       << " Jari H\u00E4kkinen and Peter Johansson.\n"
    5159       << "This is free software. You may redistribute copies of it under "
  • trunk/lib/OptionVersion.h

    r705 r724  
    5151    */
    5252    OptionVersion(CommandLine& cmd, std::string name="version",
    53                   std::string desc="print version information and exit");
     53                  std::string desc="print version information and exit",
     54                  OptionSwitch* const verbose=NULL);
    5455
    5556  private:
     57    OptionSwitch* const verbose_;
     58
    5659
    5760    /**
  • trunk/lib/utility.cc

    r709 r724  
    335335
    336336
    337   std::string version_string(void)
    338   {
    339     std::stringstream ss;
    340     ss << " (";
    341     if (DEV_BUILD)
    342       ss << "r" << svn_revision() << " ";
    343     ss << "compiled " << compilation_time() << ", " << compilation_date()
    344        << ")";
    345     return ss.str();
    346   }
    347 
    348 
    349337  std::string match(std::string::const_iterator& first,
    350338                    const std::string::const_iterator& last,
  • trunk/lib/utility.h

    r705 r724  
    226226  inline std::string trim(std::string str) { return htrim(ltrim(str)); }
    227227
    228   ///
    229   /// \return string with version info
    230   ///
    231   std::string version_string(void);
    232  
    233228
    234229  template <typename T>
Note: See TracChangeset for help on using the changeset viewer.