Changeset 234 for trunk/bin


Ignore:
Timestamp:
Apr 9, 2007, 2:08:26 PM (14 years ago)
Author:
Peter Johansson
Message:

fixes #87 and #95 and #103 and #104 and #80 and #108, and refs #69

Location:
trunk/bin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/Parameter.cc

    r229 r234  
    2424
    2525#include "Parameter.h"
     26
     27#include "ColumnStream.h"
    2628#include "utility.h"
    2729#include <config.h> // this header file is created by configure
     
    4345      bool ok=false;
    4446      std::string myargv(argv[i]);
    45       if (myargv=="-c" || myargv=="--config"){
     47      if (myargv=="--config-file"){
    4648        if (++i<argc){
    4749          config_file_= std::string(argv[i]);
     
    136138
    137139    if (config_file_.empty())
    138       runtime_error(string("svndigest: Parameter --config requires argument."));
     140      runtime_error(string("svndigest: Parameter --config-file requires argument."));
    139141
    140142  }
     
    157159  {
    158160    defaults();
    159     std::cout << "\n"
    160               << "usage: svndigest [options]\n"
    161               << "\n"
    162               << "svndigest traverses a directory structure (controlled by\n"
    163               << "subversion) and calculates developer statistics entries.\n"
    164               << "The top level directory of the directory structure to\n"
    165               << "traverse is set with the -r option. The result is written to\n"
    166               << "the current working directory or a directory set with the\n"
    167               << "-t option.\n"
    168               << "\n"
    169               << "Valid options:\n"
    170               << "  --copyright    : update copyright statement\n"
    171               << "  -c [--config] arg : configuration file ["
    172               << config_file_ << "]\n"
    173               << "  -f [--force]   : remove target directory/file if it exists\n"
    174               << "                   [no force]. NOTE recursive delete.\n"
    175               << "  -g [--generate-config] : write configuration file "
    176               << "to standard output and exit\n"
    177               << "  -h [--help]    : display this help and exit\n"
    178               << "  -r [--root] arg : svn controlled directory to perform\n"
    179               << "                    statistics calculation on ["
    180               << root_ << "]\n"
    181               << "  -rev [--revisions]: Use revision numbers as time scale\n"
    182               << "                      instead of dates [dates].\n"
    183               << "  -t [--target] arg : output directory ["
    184               << targetdir_ << "]\n"
    185               << "  -v [--verbose] : explain what is being done\n"
    186               << "  --version      : print version information and exit\n"
    187               << std::endl;
     161
     162    ColumnStream cs(std::cout, 1);
     163    cs.width(0)=68;
     164    cs.margin(0)=2;
     165    ColumnStream cs2(std::cout, 3);
     166    cs2.width(0)=24;
     167    cs2.width(1)=2;
     168    cs2.width(2)=50;
     169    cs2.margin(0)=2;
     170
     171    std::cout << "usage: svndigest [options]\n"
     172              << "\n";
     173
     174    cs << "svndigest traverses a directory structure (controlled by "
     175       << "subversion) and calculates developer statistics entries. "
     176       << "The top level directory of the directory structure to "
     177       << "traverse is set with the -r option. The result is written to "
     178       << "the current working directory or a directory set with the "
     179       << "-t option.\n";
     180    std::cout << "\nValid options:\n";
     181
     182    cs2  << "--copyright\t:\tupdate copyright statement\n"
     183         << "--config-file arg\t:\tconfiguration file ["
     184         << config_file_ << "]\n"
     185         << "-f [--force]\t:\tremove target directory/file if it exists "
     186         << "[no force]. NOTE recursive delete.\n"
     187         << "-g [--generate-config]\t:\twrite configuration file "
     188         << "to standard output and exit\n"
     189         << "-h [--help]\t:\tdisplay this help and exit\n"
     190         << "-r [--root] arg\t:\tsvn controlled directory to perform "
     191         << "statistics calculation on [" << root_ << "]\n"
     192         << "-rev [--revisions]\t:\tUse revision numbers as time scale "
     193         << "instead of dates [dates].\n"
     194         << "-t [--target] arg\t:\toutput directory [" << targetdir_ << "]\n"
     195         << "-v [--verbose]\t:\texplain what is being done\n"
     196         << "--version\t:\tprint version information and exit\n";
     197    std::cout << std::endl;
    188198  }
    189199
  • trunk/bin/svndigest.cc

    r230 r234  
    3232#include "SVN.h"
    3333#include "SVNinfo.h"
     34#include "SVNlog.h"
    3435#include "utility.h"
    3536
     
    129130  stats+=tree.parse(option->verbose());
    130131
    131   // Retrieve commit dates.
    132   std::vector<std::string> commit_dates;
     132  // Retrieve commit dates etc from SVNlog.
    133133  try {
    134134    if (option->verbose())
    135135      std::cout << "Retrieving commit dates" << std::endl;
    136136    svn->setup_ra_session(repo);
    137     commit_dates=svn->commit_dates(repo);
    138137  }
    139138  catch (SVNException e) {
     
    141140    exit(-1);
    142141  }
    143   // Is this line needed?
    144   svn->setup_ra_session(repo);
    145   std::vector<std::string> authors=svn->authors(repo);
     142  SVNlog svnlog(repo);
    146143
    147144  // remove target if needed
     
    155152    std::cout << "Generating output" << std::endl;
    156153  if (!option->revisions())
    157     GnuplotFE::instance()->set_dates(commit_dates);
     154    GnuplotFE::instance()->set_dates(svnlog.date());
    158155  chdir(option->targetdir().c_str());
    159156  mkdir(tree.name());
     
    162159                                 +tree.name()+"'");
    163160  print_css("svndigest.css");
    164   print_main_page(tree.name(), commit_dates, stats);
     161  print_main_page(tree.name(), svnlog, stats);
    165162  mkdir("all");
    166163  for (std::set<std::string>::const_iterator i = stats.authors().begin();
     
    180177        std::cout << "Updating copyright statements" << std::endl;
    181178      std::map<std::string, std::string> alias(config->copyright_alias());
    182       tree.print_copyright(commit_dates, authors, alias);
     179      tree.print_copyright(alias);
    183180    }
    184181    catch (const std::runtime_error& x) {
Note: See TracChangeset for help on using the changeset viewer.