Changeset 116
- Timestamp:
- Jun 30, 2006, 2:04:54 PM (17 years ago)
- Location:
- trunk/bin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/Parameter.cc
r106 r116 23 23 24 24 #include "Parameter.h" 25 #include "utility.h" 25 26 #include <config.h> // this header file is created by configure 26 27 … … 50 51 if (++i<argc){ 51 52 root_= std::string(argv[i]); 52 // if last character is '/' remove53 if (*root_.rbegin()=='/')54 root_.erase(root_.begin()+root_.size()-1);55 53 ok=true; 56 54 } … … 63 61 if (++i<argc){ 64 62 targetdir_= std::string(argv[i]); 65 // if last character is '/' remove66 if (*targetdir_.rbegin()=='/')67 targetdir_.erase(targetdir_.begin()+targetdir_.size()-1);68 63 ok=true; 69 64 } … … 89 84 void Parameter::analyse(void) 90 85 { 86 91 87 struct stat buf; 92 88 // check that root directory exists … … 99 95 ": No such directory."); 100 96 } 97 98 // making root absolute 99 std::string workdir(pwd()); 100 chdir(root_.c_str()); 101 root_ = pwd(); 102 // remove trailing '/' 103 if (*root_.rbegin()=='/') 104 root_.erase(root_.begin()+root_.size()-1); 105 106 // making targetdir absolute 107 chdir(targetdir_.c_str()); 108 targetdir_ = pwd(); 109 // remove trailing '/' 110 if (*targetdir_.rbegin()=='/') 111 root_.erase(targetdir_.begin()+targetdir_.size()-1); 112 113 chdir(workdir.c_str()); 114 101 115 } 102 116 … … 114 128 void Parameter::help(void) 115 129 { 130 defaults(); 116 131 std::cout << "\n" 117 132 << "usage: svnstat [options]\n" … … 120 135 << "subversion) and calculates developer statistics entries.\n" 121 136 << "The top level directory of the directory structure to\n" 122 << "traverse is set with the -t option." 123 << "The result is written to a\n" 124 << "sub-directory, svnstat, that is created in the current\n" 125 << "working directory.\n" 137 << "traverse is set with the -r option. The result is written to\n" 138 << "the current working directory or a directory set with the\n" 139 << "-t option.\n" 126 140 << "\n" 127 141 << "Valid options:\n" … … 130 144 << " -h [--help] : display this help and exit\n" 131 145 << " -r [--root] arg : svn controlled directory to perform\n" 132 << " statistics calculation on [.]\n" 146 << " statistics calculation on [" 147 << root_ << "]\n" 133 148 << " -rev [--revisions]: Use revision numbers as time scale\n" 134 149 << " instead of dates [dates].\n" 135 << " -t [--target] arg : output directory [.]\n" 150 << " -t [--target] arg : output directory [" 151 << targetdir_ << "]\n" 136 152 << " -v [--verbose] : explain what is being done\n" 137 153 << " --version : print version information and exit\n" -
trunk/bin/Parameter.h
r98 r116 36 36 inline bool force(void) const { return force_; } 37 37 inline bool revisions(void) const { return revisions_; } 38 /// @return absolute path to root directory 38 39 inline const std::string& root(void) const { return root_; } 40 /// @return absolute path to target directory 39 41 inline const std::string& targetdir(void) const { return targetdir_; } 40 42 inline bool verbose(void) const { return verbose_; }
Note: See TracChangeset
for help on using the changeset viewer.