- Timestamp:
- Jan 9, 2010, 3:16:03 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEWS
r1010 r1015 5 5 Version 0.8 (released NOT YET) 6 6 - Gnuplot replaced with plplot (ticket:97) 7 - new option --format (ticket:438) 7 8 - new configure option --with-plplot 8 9 - new default codon for `*.as` in config file -
trunk/bin/Parameter.cc
r978 r1015 63 63 std::string("ignore cache files and analyze ") + 64 64 std::string("everything from repository")), 65 format_(cmd_,"format", "override image format defined in config file"), 65 66 report_(cmd_, "report", "create no HTML report", true), 66 67 revisions_(cmd_, "revisions", … … 219 220 220 221 222 const yat::utility::OptionArg<std::string>& 223 Parameter::format(void) const 224 { 225 return format_; 226 } 227 228 221 229 void Parameter::init(void) 222 230 { … … 224 232 cmd_.program_name() = PACKAGE_NAME; 225 233 config_file_.print_arg("=FILE"); 234 format_.print_arg("=FMT"); 226 235 root_.print_arg("=ROOT"); 227 236 target_.print_arg("=TARGET"); -
trunk/bin/Parameter.h
r978 r1015 55 55 bool generate_config(void) const ; 56 56 bool ignore_cache(void) const; 57 const yat::utility::OptionArg<std::string>& format(void) const; 57 58 bool report(void) const; 58 59 bool revisions(void) const; … … 81 82 yat::utility::OptionHelp help_; 82 83 yat::utility::OptionSwitch ignore_cache_; 84 yat::utility::OptionArg<std::string> format_; 83 85 yat::utility::OptionSwitch report_; 84 86 yat::utility::OptionSwitch revisions_; -
trunk/bin/svndigest.cc
r978 r1015 37 37 38 38 #include "yat/Exception.h" 39 #include "yat/OptionArg.h" 39 40 40 41 #include <cassert> … … 81 82 config.load(is); 82 83 } 83 catch (std::runtime_error e) {84 catch (std::runtime_error& e) { 84 85 std::cerr << "svndigest: invalid config file\n" 85 86 << e.what() << std::endl; … … 87 88 } 88 89 is.close(); 90 } 91 92 // set values from commandline into config object 93 try { 94 if (option->format().present()) 95 Configuration::instance().image_format(option->format().value()); 96 } 97 catch (std::runtime_error& e) { 98 std::cerr << PACKAGE_NAME ": invalid argument `" 99 << option->format().value() << "' for `--" 100 << option->format().long_name() << "'\n" 101 << e.what() << "\n" 102 << "Try `" << PACKAGE_NAME << " --help' for more information.\n"; 103 exit(EXIT_FAILURE); 89 104 } 90 105 -
trunk/lib/Configuration.cc
r1011 r1015 297 297 else if (section == "image") { 298 298 if (lhs == "format") { 299 if (rhs!="none" && rhs!="png" && rhs!="svg"){300 throw Config_error(line, "unknown format: " +rhs);299 try { 300 image_format(rhs); 301 301 } 302 image_format_ = rhs; 302 catch (std::runtime_error e) { 303 throw Config_error(line, 304 "unknown format: " + rhs + "\n" + e.what()); 305 } 303 306 } 304 307 else if (lhs == "image_format") { … … 311 314 } 312 315 validate_dictionary(); 316 } 317 318 319 void Configuration::image_format(const std::string& format) 320 { 321 if (format!="none" && format!="png" && format!="svg") { 322 std::ostringstream oss; 323 oss << "Valid arguments are:\n" 324 << " - `none'\n" 325 << " - `png'\n" 326 << " - `svg'"; 327 throw std::runtime_error(oss.str()); 328 } 329 image_format_ = format; 313 330 } 314 331 -
trunk/lib/Configuration.h
r996 r1015 80 80 */ 81 81 const std::string& image_format(void) const; 82 83 /** 84 \brief set image_format 85 */ 86 void image_format(const std::string&); 82 87 83 88 /// -
trunk/test/Makefile.am
r991 r1015 28 28 29 29 distributed_TESTS = 30 distributed_TESTS += cmd_format_test.sh 30 31 distributed_TESTS += config2_test.sh 31 32 distributed_TESTS += copyright2_test.sh -
trunk/test/config2_test.sh
r971 r1015 29 29 $SVNDIGEST -g --config-file $srcdir/../.svndigest/config || exit_fail 30 30 31 cat > tmp_config <<EOF 32 # 33 [image] 34 format = apple 35 EOF 36 37 $SVNDIGEST -g --config-file tmp_config 2> tmp_stderr && exit_fail 38 grep 'unknown format.* apple' tmp_stderr || exit_fail 39 rm -f tmp_stderr tmp_config 31 40 exit_success -
trunk/test/repo_test.sh
r978 r1015 25 25 . ./init.sh || exit 1 26 26 27 $mkdir_p $targetdir;28 29 27 $SVNDIGEST -r $rootdir -t $targetdir --ignore-cache --no-report || exit_fail; 30 28
Note: See TracChangeset
for help on using the changeset viewer.