Changeset 724 for trunk


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
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.am

    r720 r724  
    2424ACLOCAL_AMFLAGS = -I build_support --install
    2525
    26 SUBDIRS = lib bin test
     26SUBDIRS = lib bin man test
    2727
    2828EXTRA_dist = build_support/move-if-change
  • trunk/README.developer

    r693 r724  
    2020We follow these guidelines.
    2121
     22
     23=== Requirements ===
     24
     25To build from a subversion checkout, you will need Autotools. More
     26specifically Automake 1.10 (or later) and Autoconf 2.60 (or later). To
     27build man page you will need help2man.
    2228
    2329=== bootstrap and autoreconf ===
  • trunk/bin/Parameter.cc

    r719 r724  
    248248   
    249249    verbose_ = new OptionSwitch(cmd_, "v,verbose", "explain what is being done");
    250     version_ = new OptionVersion(cmd_);
     250    version_ = new OptionVersion(cmd_, "version",
     251                                 "print version information and exit", verbose_);
    251252
    252253    ss.str("");
  • trunk/configure.ac

    r723 r724  
    7575AC_PROG_RANLIB
    7676AC_PROG_SED
     77AM_MISSING_PROG([HELP2MAN], [help2man])
    7778AC_CHECK_PROG([GNUPLOT],[gnuplot],[ok])
    7879
     
    182183                bin/Makefile
    183184                lib/Makefile
     185                man/Makefile
    184186                test/environment.h
    185187                test/Makefile])
  • 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.