| 212 | } |
| 213 | |
| 214 | int |
| 215 | main(int argc, char **argv) |
| 216 | { |
| 217 | int argerr = 0; |
| 218 | int flag; |
| 219 | const char *source = NULL; |
| 220 | char *admin_input_xml = NULL; |
| 221 | char *admin_input_file = NULL; |
| 222 | gboolean dangerous_cmd = FALSE; |
| 223 | gboolean admin_input_stdin = FALSE; |
| 224 | xmlNode *output = NULL; |
| 225 | xmlNode *input = NULL; |
| 226 | |
| 227 | int option_index = 0; |
| 228 | |
| 229 | crm_log_init(NULL, LOG_CRIT, FALSE, FALSE, argc, argv, FALSE); |
| 230 | crm_set_options(NULL, "command [options] [data]", long_options, |
| 231 | "Provides direct access to the cluster configuration." |
| 232 | "\n\nAllows the configuration, or sections of it, to be queried, modified, replaced and deleted." |
| 233 | "\n\nWhere necessary, XML data will be obtained using the -X, -x, or -p options\n"); |
| 234 | |
| 235 | if (argc < 2) { |
| 236 | crm_help('?', EX_USAGE); |
| 237 | } |
| 238 | |
| 239 | while (1) { |
| 240 | flag = crm_get_option(argc, argv, &option_index); |
| 241 | if (flag == -1) |
| 242 | break; |
| 243 | |
| 244 | switch (flag) { |
| 245 | case 't': |
| 246 | message_timeout_ms = atoi(optarg); |
| 247 | if (message_timeout_ms < 1) { |
| 248 | message_timeout_ms = 30; |
| 249 | } |
| 250 | break; |
| 251 | case 'A': |
| 252 | obj_type = strdup(optarg); |
| 253 | command_options |= cib_xpath; |
| 254 | break; |
| 255 | case 'e': |
| 256 | command_options |= cib_xpath_address; |
| 257 | break; |
| 258 | case 'u': |
| 259 | cib_action = CIB_OP_UPGRADE; |
| 260 | dangerous_cmd = TRUE; |
| 261 | break; |
| 262 | case 'E': |
| 263 | cib_action = CIB_OP_ERASE; |
| 264 | dangerous_cmd = TRUE; |
| 265 | break; |
| 266 | case 'Q': |
| 267 | cib_action = CIB_OP_QUERY; |
| 268 | break; |
| 269 | case 'P': |
| 270 | cib_action = CIB_OP_APPLY_DIFF; |
| 271 | break; |
nothing calls this directly
no test coverage detected