20typedef std::map<String,std::function<String(
void)>>
CMapT;
33 std::cout <<
"usage: " << prog <<
" ";
34 for(
const auto& x: cm){
35 std::cout <<
"[" << x.first <<
"] ";
37 std::cout << std::endl;
40int main(
int argc,
char** argv)
42 const String prog(argv[0]);
48 for(SizeT i = 1; i !=
static_cast<SizeT
>(argc); ++i){
49 std::cout << cm.at( String(argv[i]) )() << std::endl;
52 catch(
const std::out_of_range& e){
53 std::cerr <<
"caught exception: " << e.what() << std::endl;
58 std::cerr <<
"caught generic exception" << std::endl;
std::map< String, std::function< String(void)> > CMapT
void printUsage(const String &prog, const CMapT &cm)
int main(int argc, char **argv)
Runtime config functions declarations.