1 /* COPYING ******************************************************************
2 For copyright and licensing terms, see the file named COPYING.
3 // **************************************************************************
4 */
5 
6 #include <iostream>
7 #include <iomanip>
8 #include <cstring>
9 #include <cstdlib>
10 #include <cctype>
11 
12 #include "popt.h"
13 
14 using namespace popt;
15 
~simple_named_definition()16 simple_named_definition::~simple_named_definition() {}
execute(processor & proc,char c)17 bool simple_named_definition::execute(processor & proc, char c)
18 {
19 	if (char the_short_name = query_short_name()) {
20 		if (the_short_name == c) {
21 			action(proc);
22 			return true;
23 		}
24 	}
25 	return false;
26 }
execute(processor &,char,const char *)27 bool simple_named_definition::execute(processor &, char, const char *)
28 {
29 	return false;
30 }
execute(processor & proc,const char * s)31 bool simple_named_definition::execute(processor & proc, const char * s)
32 {
33 	if (const char * the_long_name = query_long_name()) {
34 		if (0 == std::strcmp(the_long_name, s)) {
35 			action(proc);
36 			return true;
37 		}
38 	}
39 	return false;
40 }
41