Changeset 240


Ignore:
Timestamp:
Apr 28, 2007, 3:43:54 AM (14 years ago)
Author:
Peter Johansson
Message:

removed -rev flag (there is still --revsions). Changed help output to be more gnu-like. Changed default config-file to be <ROOT>/.svndigest/config.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r192 r240  
    2222======================================================================
    2323
    24 
     24version 0.6:
     25  - Removed option flag '-rev'
     26 
    2527version 0.5:
    2628  - Updated documentation.
  • trunk/bin/Parameter.cc

    r234 r240  
    7373        }
    7474      }
    75       else if (myargv=="-rev" || myargv=="--revisions") {
     75      else if (myargv=="--revisions") {
    7676          revisions_=true;
    7777          ok=true;
     
    135135    // return back to cwd
    136136    if (chdir(workdir.c_str()))
    137       runtime_error(string("svndigest: Failed to access cwd: ") + workdir);
    138 
    139     if (config_file_.empty())
    140       runtime_error(string("svndigest: Parameter --config-file requires argument."));
    141 
     137      throw runtime_error(string("svndigest: Failed to access cwd: ") + workdir);
     138
     139  }
     140
     141
     142  std::string Parameter::config_file(void) const
     143  {
     144    // not default
     145    if (!config_file_.empty())
     146      return config_file_;
     147   
     148    // default behaviour
     149    return root()+"/.svndigest/config";
    142150  }
    143151
     
    145153  void Parameter::defaults(void)
    146154  {
    147     config_file_ = getenv("HOME")+"/.svndigest/config";
     155    config_file_ = "";
    148156    copyright_=false;
    149157    force_=false;
     
    180188    std::cout << "\nValid options:\n";
    181189
    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 "
     190    cs2  << "    --copyright\t:\tupdate copyright statement\n"
     191         << "    --config-file=ARG\t:\tconfiguration file "
     192         << "[<ROOT>/.svndigest/config]\n"
     193         << "-f, --force\t:\tremove target directory/file if it exists "
     194         << "NOTE recursive delete.\n"
     195         << "-g, --generate-config\t:\twrite configuration file "
    188196         << "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 "
     197         << "-h, --help\t:\tdisplay this help and exit\n"
     198         << "-r, --root=ROOT\t:\tsvn controlled directory to perform "
    191199         << "statistics calculation on [" << root_ << "]\n"
    192          << "-rev [--revisions]\t:\tUse revision numbers as time scale "
     200         << "    --revisions\t:\tUse revision numbers as time scale "
    193201         << "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";
     202         << "-t, --target=TARGET\t:\toutput directory [" << targetdir_ << "]\n"
     203         << "-v, --verbose\t:\texplain what is being done\n"
     204         << "    --version\t:\tprint version information and exit\n";
    197205    std::cout << std::endl;
    198206  }
  • trunk/bin/Parameter.h

    r229 r240  
    3636  public:
    3737    Parameter(const int argc,const char *argv[]);
    38     inline std::string config_file(void) const { return config_file_; }
     38    std::string config_file(void) const;
    3939    inline bool copyright(void) const { return copyright_; }
    4040    /// @todo
Note: See TracChangeset for help on using the changeset viewer.