MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / main

Function main

tools/xml_diff.c:71–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69/* *INDENT-ON* */
70
71int
72main(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;

Callers

nothing calls this directly

Calls 15

crm_log_cli_initFunction · 0.85
crm_set_optionsFunction · 0.85
crm_helpFunction · 0.85
crm_get_optionFunction · 0.85
crm_bump_log_levelFunction · 0.85
string2xmlFunction · 0.85
stdin2xmlFunction · 0.85
filename2xmlFunction · 0.85
apply_xml_diffFunction · 0.85
apply_cib_diffFunction · 0.85
diff_xml_objectFunction · 0.85
log_xml_diffFunction · 0.85

Tested by

no test coverage detected