| 69 | /* *INDENT-ON* */ |
| 70 | |
| 71 | int |
| 72 | main(int argc, char **argv) |
| 73 | { |
| 74 | gboolean apply = FALSE; |
| 75 | gboolean raw_1 = FALSE; |
| 76 | gboolean raw_2 = FALSE; |
| 77 | gboolean filter = FALSE; |
| 78 | gboolean use_stdin = FALSE; |
| 79 | gboolean as_cib = FALSE; |
| 80 | int argerr = 0; |
| 81 | int flag; |
| 82 | xmlNode *object_1 = NULL; |
| 83 | xmlNode *object_2 = NULL; |
| 84 | xmlNode *output = NULL; |
| 85 | const char *xml_file_1 = NULL; |
| 86 | const char *xml_file_2 = NULL; |
| 87 | |
| 88 | int option_index = 0; |
| 89 | |
| 90 | crm_log_cli_init("crm_diff"); |
| 91 | crm_set_options(NULL, "original_xml operation [options]", long_options, |
| 92 | "A utility for comparing Pacemaker configurations (XML format)\n\n" |
| 93 | "The tool produces a custom (diff-like) output which it can also apply like a patch\n"); |
| 94 | |
| 95 | if (argc < 2) { |
| 96 | crm_help('?', EX_USAGE); |
| 97 | } |
| 98 | |
| 99 | while (1) { |
| 100 | flag = crm_get_option(argc, argv, &option_index); |
| 101 | if (flag == -1) |
| 102 | break; |
| 103 | |
| 104 | switch (flag) { |
| 105 | case 'o': |
| 106 | xml_file_1 = optarg; |
| 107 | break; |
| 108 | case 'O': |
| 109 | xml_file_1 = optarg; |
| 110 | raw_1 = TRUE; |
| 111 | break; |
| 112 | case 'n': |
| 113 | xml_file_2 = optarg; |
| 114 | break; |
| 115 | case 'N': |
| 116 | xml_file_2 = optarg; |
| 117 | raw_2 = TRUE; |
| 118 | break; |
| 119 | case 'p': |
| 120 | xml_file_2 = optarg; |
| 121 | apply = TRUE; |
| 122 | break; |
| 123 | case 'f': |
| 124 | filter = TRUE; |
| 125 | break; |
| 126 | case 's': |
| 127 | use_stdin = TRUE; |
| 128 | break; |
nothing calls this directly
no test coverage detected