diff --git a/main.cpp b/main.cpp index bd2c351..1e8a03f 100644 --- a/main.cpp +++ b/main.cpp @@ -1,9 +1,42 @@ #include "main.hpp" +#include "WordReference.hpp" #include +#include +#include +#include +#include + +#ifndef NDEBUG +#define UNDEF_NDEBUG +#define NDEBUG +#endif +#include +#ifdef UNDEF_NDEBUG +#undef UNDEF_NDEBUG +#undef NDEBUG +#endif + +namespace { + ///------------------------------------------------------------------------- + ///------------------------------------------------------------------------- + void GetCommandLine (boost::program_options::variables_map& parVarMap, int parArgc, const char* const parArgv[]) { + boost::program_options::options_description desc("Program parameters"); + desc.add_options() + ("help", "show this help screen") + ; + + boost::program_options::store(boost::program_options::parse_command_line(parArgc, parArgv, desc), parVarMap); + boost::program_options::notify(parVarMap); + } +} //unnamed namespace ///----------------------------------------------------------------------------- ///----------------------------------------------------------------------------- -int main (int parArgc, const char* const argv[]) { - std::cout << "Hello world\n"; +int main (int parArgc, const char* const parArgv[]) { + WordReference wref("en", "it"); + + boost::program_options::variables_map vm; + GetCommandLine(vm, parArgc, parArgv); + std::cout << wref.GetHttpLink("north face") << "\n© WordReference.com" << std::endl; return 0; } diff --git a/main.hpp b/main.hpp index 5e05b18..9a4f2e4 100644 --- a/main.hpp +++ b/main.hpp @@ -2,5 +2,8 @@ #define id80FAB3D5977B4A1797F2910935B34AEA #include +#include +#include +#include #endif