[165] | 1 | #ifndef _theplu_svndigest_parameter_ |
---|
| 2 | #define _theplu_svndigest_parameter_ |
---|
| 3 | |
---|
[37] | 4 | // $Id: Parameter.h 626 2008-04-23 23:05:09Z peter $ |
---|
| 5 | |
---|
[84] | 6 | /* |
---|
| 7 | Copyright (C) 2006 Jari Häkkinen, Peter Johansson |
---|
[225] | 8 | Copyright (C) 2007 Peter Johansson |
---|
[84] | 9 | |
---|
[519] | 10 | This file is part of svndigest, http://trac.thep.lu.se/svndigest |
---|
[84] | 11 | |
---|
[149] | 12 | svndigest is free software; you can redistribute it and/or modify it |
---|
[84] | 13 | under the terms of the GNU General Public License as published by |
---|
| 14 | the Free Software Foundation; either version 2 of the License, or |
---|
| 15 | (at your option) any later version. |
---|
| 16 | |
---|
[149] | 17 | svndigest is distributed in the hope that it will be useful, but |
---|
[84] | 18 | WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
[149] | 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
[84] | 20 | General Public License for more details. |
---|
| 21 | |
---|
| 22 | You should have received a copy of the GNU General Public License |
---|
| 23 | along with this program; if not, write to the Free Software |
---|
| 24 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
---|
| 25 | 02111-1307, USA. |
---|
| 26 | */ |
---|
| 27 | |
---|
[625] | 28 | #include "Option.h" |
---|
| 29 | |
---|
[225] | 30 | #include <map> |
---|
[37] | 31 | #include <string> |
---|
| 32 | |
---|
| 33 | namespace theplu { |
---|
[149] | 34 | namespace svndigest { |
---|
[37] | 35 | |
---|
| 36 | // class for command line options. |
---|
| 37 | class Parameter { |
---|
| 38 | public: |
---|
[518] | 39 | Parameter( int argc, char *argv[]); |
---|
[240] | 40 | std::string config_file(void) const; |
---|
[625] | 41 | inline bool copyright(void) const { return copyright_.value(); } |
---|
[225] | 42 | /// @todo |
---|
[625] | 43 | inline bool force(void) const { return force_.value(); } |
---|
| 44 | inline bool generate_config(void) const { return generate_config_.value(); } |
---|
| 45 | inline bool ignore_cache(void) const { return ignore_cache_.value(); } |
---|
| 46 | inline bool report(void) const { return report_.value(); } |
---|
| 47 | inline bool revisions(void) const { return revisions_.value(); } |
---|
[116] | 48 | /// @return absolute path to root directory |
---|
[625] | 49 | inline const std::string& root(void) const { return root_.value(); } |
---|
[116] | 50 | /// @return absolute path to target directory |
---|
[625] | 51 | inline const std::string& targetdir(void) const |
---|
| 52 | { return targetdir_.value(); } |
---|
| 53 | inline bool verbose(void) const { return verbose_.value(); } |
---|
[37] | 54 | |
---|
| 55 | private: |
---|
| 56 | void analyse(void); |
---|
[625] | 57 | void help(void) const; |
---|
[626] | 58 | void missing_argument(std::string opt) const; |
---|
[540] | 59 | void version(bool=false) const; |
---|
[37] | 60 | |
---|
[625] | 61 | Option<std::string> config_file_; |
---|
| 62 | Option<bool> copyright_; |
---|
| 63 | Option<bool> force_; |
---|
| 64 | Option<bool> generate_config_; |
---|
| 65 | Option<bool> ignore_cache_; |
---|
| 66 | Option<bool> report_; |
---|
| 67 | Option<bool> revisions_; |
---|
| 68 | Option<std::string> root_; |
---|
| 69 | Option<std::string> targetdir_; |
---|
| 70 | Option<bool> verbose_; |
---|
[37] | 71 | }; |
---|
| 72 | |
---|
[149] | 73 | }} // of namespace svndigest and namespace theplu |
---|
[37] | 74 | |
---|
| 75 | #endif |
---|