Skip to content

madosuki/CmdOptionParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CmdOptionParser

CmdOptionParser is options parser for command line.

Usage

std::vector<std::pair<std::string, bool> > option_key_list = { std::make_pair("string", false)}; 
auto i = std::make_unique<CmdOption>(argv, argc, "--",  option_key_list);

option_key_list is option key list; that list is using std::pair<std::string, bool>.
first is key. second is whether exists value, when that value is true is meaning that option is pair of key and value, when false is meaning that option is not pair.

then run above

auto count = i.get()->DetectOptions();

DetectOptions method is search option from string list using arbitrary option list.
That method is if found value then append to option_list of private member and return found value count.

auto result = i.get()->GetOptions();

GetOptions method is return std::vector<std::pair<std::string, std::string> >.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published