Skip to content

Commit

Permalink
fix program_options
Browse files Browse the repository at this point in the history
  • Loading branch information
sinev-valentine committed Oct 18, 2018
1 parent 2ddf0de commit 54f75aa
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions keychain_cmd_app/cmd_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,30 +40,40 @@ int cmd_parser::run(int argc, const char* const argv [])
("help,h", "Show help")
("mode", po::value<std::string>(&task_type), "Select mode=test_run for test program with \"blank\" password");

po::variables_map vm;
po::variables_map options;
try
{
po::parsed_options parsed = po::command_line_parser(argc, argv).options(desc).allow_unregistered().run();
po::store(parsed, vm);
po::notify(vm);
po::store(parsed, options);
po::notify(options);

if( options.count("help") )
{
std::cout << desc << std::endl;
return 0;
}

if (task_type == "test_run")
sec_mod = secure_module<sec_mod_dummy>::instance();
else if (task_type == "")
{
#ifdef LINUX
sec_mod = secure_module<sec_mod_linux>::instance();
sec_mod = secure_module<sec_mod_linux>::instance();
#else
sec_mod = secure_module<sec_mod_dummy>::instance();
sec_mod = secure_module<sec_mod_dummy>::instance();
#endif
}
else
{
std::cout<< desc << std::endl;
return 0;
}

}
catch (std::exception& ex)
{
std::cout<< desc << std::endl;
return 0;
std::cout<< desc << std::endl;
return 0;
}

keychain_invoke_f f = std::bind(&keychain_wrapper, sec_mod, std::placeholders::_1);
Expand Down

0 comments on commit 54f75aa

Please sign in to comment.