Changeset 49 for trunk/bin/Parameter.cc


Ignore:
Timestamp:
Jan 14, 2006, 1:53:56 AM (16 years ago)
Author:
Jari Häkkinen
Message:

bin directory compiles but svnstat not finished.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/Parameter.cc

    r39 r49  
    44
    55#include <iostream>
     6#include <stdexcept>
    67#include <string>
    78
     
    1011
    1112  Parameter::Parameter(const int argc,const char *argv[])
    12     : force_(false), outdir_("svnstat"), root_("."), verbose_(false)
     13    : force_(false), root_("."), targetdir_("svnstat_output"), verbose_(false)
    1314  {
    1415 
     
    1819      if (myargv=="-d" || myargv=="--directory"){
    1920        if (++i<argc){
    20           outdir_= std::string(argv[i]);
     21          targetdir_= std::string(argv[i]);
    2122          ok=true;
    2223        }
     
    4243        ok = true;
    4344      }
    44       if (!ok){
    45         std::cerr << "svnstat: invalid option: " << myargv << "\n"
    46                   << "Type 'svnstat --help' for usage." << std::endl;
    47         exit(-1);
    48       }
     45
     46      if (!ok)
     47        throw std::runtime_error("svnstat: invalid option: " + myargv +
     48                                 "\nType 'svnstat --help' for usage.");
    4949    }
    5050
     
    7171              << "\n"
    7272              << "Valid options:\n"
    73               << "  -d [--dir] arg : output directory [svnstat]\n"
    74               << "  -f [--force]   : overwrite existing files\n"
     73              << "  -d [--dir] arg : output target directory [svnstat_output]\n"
     74              << "  -f [--force]   : remove target directory/file if it exists\n"
     75              << "                   [no force]\n"
    7576              << "  -h [--help]    : display this help and exit\n"
    7677              << "  -v [--verbose] : explain what is being done\n"
Note: See TracChangeset for help on using the changeset viewer.