| 2 | #include <getopt.h> |
| 3 | |
| 4 | static bool matched(const std::vector<std::string>& tokens, const char* name) { |
| 5 | for (std::vector<std::string>::const_iterator cit = tokens.begin(); |
| 6 | cit != tokens.end(); ++cit) { |
| 7 | if (*cit == name) { |
| 8 | return true; |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | return false; |
| 13 | } |
| 14 | |
| 15 | static void usage(const char* procname) { |
| 16 | printf("usage: %s -h [help[ -f json_file -n names -D [remove if matched]\r\n", procname); |