Changeset 1070


Ignore:
Timestamp:
Jun 6, 2010, 5:32:03 AM (11 years ago)
Author:
Peter Johansson
Message:

refs #307. write config if option for it is given

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/svncopyright.cc

    r1067 r1070  
    2222#include "svncopyrightParameter.h"
    2323
     24#include "Configuration.h"
    2425#include "main_utility.h"
    2526
     
    4748  try {
    4849    load_config(option.config_file());
     50    if (option.generate_config()) {
     51      std::cout << Configuration::instance();
     52      return EXIT_SUCCESS;
     53    }
    4954  }
    5055  catch (std::runtime_error& e) {
  • trunk/bin/svndigest.cc

    r1069 r1070  
    7676    load_config(option.config_file());
    7777    copy_option2config(option, Configuration::instance());
     78    if (option.generate_config()) {
     79      std::cout << Configuration::instance();
     80      return EXIT_SUCCESS;
     81    }
    7882  }
    7983  catch (std::runtime_error& e) {
     
    8488  // just for convenience
    8589  Configuration& config = Configuration::instance();
    86   // set values from commandline into config object
    87   // write configuration
    88   if (option.generate_config()) {
    89     std::cout << config;
    90     exit(EXIT_SUCCESS);
    91   }
    9290
    9391  SVN* svn=NULL;
  • trunk/lib/main_utility.cc

    r1067 r1070  
    2525#include "utility.h"
    2626
     27#include <cctype>
    2728#include <fstream>
     29#include <iostream>
    2830#include <string>
    2931#include <stdexcept>
     
    5254
    5355
     56  void write_config_and_exit(void)
     57  {
     58    std::cout << Configuration::instance();
     59    exit(EXIT_SUCCESS);
     60  }
    5461
    5562}} // end of namespace svndigest and namespace theplu
  • trunk/lib/main_utility.h

    r1067 r1070  
    4141  void load_config(const std::string& file);
    4242
     43  /**
     44     write configuration file to cout and exit successfully
     45   */
     46  void write_config_and_exit(void);
     47
    4348}} // end of namespace svndigest end of namespace theplu
    4449
Note: See TracChangeset for help on using the changeset viewer.