#include <string>
#include <vector>
using namespace std;
pair<string, string> parserDashDashShort(const string& s)
{
string str = s.substr( 0, s.find('=') );
if( str.length()==3 && str[0]=='-' && str[1]=='-' && str[2]<='z' && str[2]>='a')
{
string val = s.substr(str.length());
return make_pair( str.substr(1), val );
}
return make_pair(string(), string());
}
int _tmain(int , _TCHAR* argv[])
{
int style =
command_line_style::allow_short|
command_line_style::allow_dash_for_short |
command_line_style::short_allow_adjacent;
options_description desc;
desc.add_options()
("help,h", "help message")
;
char* args[]={"program.exe", "--h"};
int argc = sizeof( args ) / sizeof( args[0] );
parse_command_line<char>( argc, (char**)args, desc, style, parserDashDashShort );
return 0;
}