Changeset d5240d for src/UIElements/CommandLineUI
- Timestamp:
- Dec 4, 2010, 11:47:35 PM (14 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- c82d0c
- Parents:
- ae21cbd
- git-author:
- Frederik Heber <heber@…> (11/11/10 14:39:10)
- git-committer:
- Frederik Heber <heber@…> (12/04/10 23:47:35)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/CommandLineUI/CommandLineParser_validate.cpp
rae21cbd rd5240d 19 19 20 20 #include "Helpers/MemDebug.hpp" 21 22 #include <boost/version.hpp> 21 23 22 24 #include <iostream> … … 41 43 if (values.size() != 1) { 42 44 std::cerr << "Not one vector but " << values.size() << " given " << std::endl; 45 #if BOOST_VERSION < 104200 43 46 throw boost::program_options::validation_error("Unequal to one vector given"); 47 #else 48 throw boost::program_options::validation_error( 49 boost::program_options::validation_error::invalid_option_value, 50 std::string("value"), 51 std::string("VectorValue") 52 ); 53 #endif 44 54 } 45 55 std::string argument(values.at(0)); … … 59 69 if (components.size() != 3) { 60 70 std::cerr << "Specified vector does not have three components but " << components.size() << std::endl; 71 #if BOOST_VERSION < 104200 61 72 throw boost::program_options::validation_error("Specified vector does not have three components"); 73 #else 74 throw boost::program_options::validation_error( 75 boost::program_options::validation_error::invalid_option_value, 76 std::string("value"), 77 std::string("VectorValue") 78 ); 79 #endif 62 80 } 63 81 VV.x = boost::lexical_cast<double>(components.at(0)); … … 75 93 if (values.size() != 1) { 76 94 std::cerr << "Not one vector but " << values.size() << " given " << std::endl; 95 #if BOOST_VERSION < 104200 77 96 throw boost::program_options::validation_error("Unequal to one vector given"); 97 #else 98 throw boost::program_options::validation_error( 99 boost::program_options::validation_error::invalid_option_value, 100 std::string("value"), 101 std::string("BoxValue") 102 ); 103 #endif 78 104 } 79 105 std::string argument(values.at(0)); … … 93 119 if (components.size() != 6) { 94 120 std::cerr << "Specified vector does not have three components but " << components.size() << std::endl; 121 #if BOOST_VERSION < 104200 95 122 throw boost::program_options::validation_error("Specified symmetric box matrix does not have six components"); 123 #else 124 throw boost::program_options::validation_error( 125 boost::program_options::validation_error::invalid_option_value, 126 std::string("value"), 127 std::string("BoxValue") 128 ); 129 #endif 96 130 } 97 131 BV.xx = boost::lexical_cast<double>(components.at(0)); … … 120 154 if (values.size() != 1) { 121 155 std::cerr << "Not one file but " << values.size() << " given " << std::endl; 156 #if BOOST_VERSION < 104200 122 157 throw boost::program_options::validation_error("Unequal to one file given"); 158 #else 159 if (values.size() == 0) { 160 throw boost::program_options::validation_error( 161 boost::program_options::validation_error::at_least_one_value_required, 162 std::string("value"), 163 std::string("boost::filesystem::path") 164 ); 165 } else { 166 throw boost::program_options::validation_error( 167 boost::program_options::validation_error::multiple_values_not_allowed, 168 std::string("value"), 169 std::string("boost::filesystem::path") 170 ); 171 } 172 #endif 123 173 } 124 174 filename = values.at(0);
Note:
See TracChangeset
for help on using the changeset viewer.