source: trunk/lib/OptionVersion.cc @ 705

Last change on this file since 705 was 705, checked in by Peter Johansson, 13 years ago

importing classes for commandline parsing from yat. This fixes #349 and #265

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1// $Id: OptionVersion.cc 705 2008-11-25 23:33:26Z peter $
2
3/*
4  Copyright (C) 2008 Peter Johansson
5
6  This file is part of svndigest, http://dev.thep.lu.se/svndigest
7
8  svndigest is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 3 of the
11  License, or (at your option) any later version.
12
13  svndigest is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17
18  You should have received a copy of the GNU General Public License
19  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#include <config.h>
23
24#include "OptionVersion.h"
25#include "ColumnStream.h"
26#include "CommandLine.h"
27#include "subversion_info.h"
28#include "utility.h"
29
30#include <sstream>
31#include <string>
32
33namespace theplu {
34namespace svndigest {
35
36  OptionVersion::OptionVersion(CommandLine& cmd, std::string flag, 
37                               std::string desc)
38    : OptionSwitch(cmd, flag, desc, false)
39  {
40  }
41
42
43  void OptionVersion::do_parse2(std::vector<std::string>::iterator first, 
44                                std::vector<std::string>::iterator last)
45  {
46    ColumnStream cs(std::cout, 1);
47    cs.width(0)=79;
48    cs << PACKAGE_NAME << " " << PACKAGE_VERSION << version_string() << "\n";
49    cs << "\nCopyright (C) " << svn_year() 
50       << " Jari H\u00E4kkinen and Peter Johansson.\n"
51       << "This is free software. You may redistribute copies of it under "
52       << "the terms of the GNU General Public License "
53       << "<http://www.gnu.org/licenses/gpl.html>.\n"
54       << "There is NO WARRANTY; to the extent permitted by law.\n";
55    exit(0);
56  }
57
58}} // of namespace svndigest and theplu
Note: See TracBrowser for help on using the repository browser.