705 |
25 Nov 08 |
peter |
1 |
#ifndef _theplu_svndigest_option_version_ |
705 |
25 Nov 08 |
peter |
2 |
#define _theplu_svndigest_option_version_ |
705 |
25 Nov 08 |
peter |
3 |
|
705 |
25 Nov 08 |
peter |
// $Id$ |
705 |
25 Nov 08 |
peter |
5 |
|
705 |
25 Nov 08 |
peter |
6 |
/* |
1635 |
30 Mar 23 |
peter |
Copyright (C) 2008, 2009, 2010 Peter Johansson |
705 |
25 Nov 08 |
peter |
8 |
|
1059 |
18 May 10 |
peter |
This file is part of svndigest, http://dev.thep.lu.se/svndigest |
705 |
25 Nov 08 |
peter |
10 |
|
705 |
25 Nov 08 |
peter |
svndigest is free software; you can redistribute it and/or modify it |
705 |
25 Nov 08 |
peter |
under the terms of the GNU General Public License as published by |
705 |
25 Nov 08 |
peter |
the Free Software Foundation; either version 2 of the License, or |
705 |
25 Nov 08 |
peter |
(at your option) any later version. |
705 |
25 Nov 08 |
peter |
15 |
|
705 |
25 Nov 08 |
peter |
svndigest is distributed in the hope that it will be useful, but |
705 |
25 Nov 08 |
peter |
WITHOUT ANY WARRANTY; without even the implied warranty of |
705 |
25 Nov 08 |
peter |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
705 |
25 Nov 08 |
peter |
General Public License for more details. |
705 |
25 Nov 08 |
peter |
20 |
|
705 |
25 Nov 08 |
peter |
You should have received a copy of the GNU General Public License |
705 |
25 Nov 08 |
peter |
along with this program; if not, write to the Free Software |
705 |
25 Nov 08 |
peter |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
705 |
25 Nov 08 |
peter |
02111-1307, USA. |
705 |
25 Nov 08 |
peter |
25 |
*/ |
705 |
25 Nov 08 |
peter |
26 |
|
795 |
30 Jun 09 |
peter |
27 |
#include "yat/OptionSwitch.h" |
705 |
25 Nov 08 |
peter |
28 |
|
705 |
25 Nov 08 |
peter |
29 |
#include <string> |
705 |
25 Nov 08 |
peter |
30 |
|
705 |
25 Nov 08 |
peter |
31 |
namespace theplu { |
795 |
30 Jun 09 |
peter |
32 |
namespace yat { |
795 |
30 Jun 09 |
peter |
33 |
namespace utility { |
795 |
30 Jun 09 |
peter |
34 |
class CommandLine; |
795 |
30 Jun 09 |
peter |
35 |
}} |
705 |
25 Nov 08 |
peter |
36 |
namespace svndigest { |
705 |
25 Nov 08 |
peter |
37 |
|
705 |
25 Nov 08 |
peter |
38 |
/** |
705 |
25 Nov 08 |
peter |
\brief Class for version option |
705 |
25 Nov 08 |
peter |
40 |
|
705 |
25 Nov 08 |
peter |
When this option is found in parsing of commandline, it displays |
705 |
25 Nov 08 |
peter |
version output. |
705 |
25 Nov 08 |
peter |
43 |
*/ |
795 |
30 Jun 09 |
peter |
44 |
class OptionVersion : public yat::utility::OptionSwitch |
705 |
25 Nov 08 |
peter |
45 |
{ |
705 |
25 Nov 08 |
peter |
46 |
public: |
705 |
25 Nov 08 |
peter |
47 |
/** |
1513 |
23 Sep 12 |
peter |
\brief Constructor |
1513 |
23 Sep 12 |
peter |
49 |
|
705 |
25 Nov 08 |
peter |
\param cmd Commandline Option is associated with |
705 |
25 Nov 08 |
peter |
\param name string such as "help" for --help, "h" for -h or |
705 |
25 Nov 08 |
peter |
"h,help" (default) for having both short and long option name |
705 |
25 Nov 08 |
peter |
\param desc string used in help display |
705 |
25 Nov 08 |
peter |
54 |
*/ |
1513 |
23 Sep 12 |
peter |
55 |
OptionVersion(yat::utility::CommandLine& cmd, std::string name="version", |
724 |
09 Dec 08 |
peter |
56 |
std::string desc="print version information and exit", |
1513 |
23 Sep 12 |
peter |
57 |
OptionSwitch* const verbose=NULL); |
705 |
25 Nov 08 |
peter |
58 |
|
1058 |
24 Apr 10 |
peter |
59 |
/** |
1060 |
02 Jun 10 |
peter |
add extra string appended to output |
1060 |
02 Jun 10 |
peter |
61 |
*/ |
1060 |
02 Jun 10 |
peter |
62 |
void extra(const std::string&); |
1060 |
02 Jun 10 |
peter |
63 |
|
1060 |
02 Jun 10 |
peter |
64 |
/** |
1060 |
02 Jun 10 |
peter |
set program name |
1060 |
02 Jun 10 |
peter |
66 |
*/ |
1060 |
02 Jun 10 |
peter |
67 |
void program_name(const std::string&); |
1060 |
02 Jun 10 |
peter |
68 |
|
1060 |
02 Jun 10 |
peter |
69 |
/** |
1058 |
24 Apr 10 |
peter |
\brief set version string |
1058 |
24 Apr 10 |
peter |
71 |
*/ |
1058 |
24 Apr 10 |
peter |
72 |
void version(const std::string&); |
1058 |
24 Apr 10 |
peter |
73 |
|
705 |
25 Nov 08 |
peter |
74 |
private: |
724 |
09 Dec 08 |
peter |
75 |
OptionSwitch* const verbose_; |
1060 |
02 Jun 10 |
peter |
76 |
std::string extra_; |
1060 |
02 Jun 10 |
peter |
77 |
std::string prog_name_; |
705 |
25 Nov 08 |
peter |
78 |
|
705 |
25 Nov 08 |
peter |
79 |
/** |
705 |
25 Nov 08 |
peter |
80 |
*/ |
1513 |
23 Sep 12 |
peter |
81 |
void do_parse2(std::vector<std::string>::iterator, |
705 |
25 Nov 08 |
peter |
82 |
std::vector<std::string>::iterator); |
705 |
25 Nov 08 |
peter |
83 |
|
705 |
25 Nov 08 |
peter |
84 |
}; |
705 |
25 Nov 08 |
peter |
85 |
|
705 |
25 Nov 08 |
peter |
86 |
}} // of namespace svndigest and theplu |
705 |
25 Nov 08 |
peter |
87 |
|
705 |
25 Nov 08 |
peter |
88 |
#endif |