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

Function main

tools/crm_error.c:34–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32/* *INDENT-ON* */
33
34int
35main(int argc, char **argv)
36{
37 int rc = 0;
38 int lpc = 0;
39 int flag = 0;
40 int option_index = 0;
41
42 crm_log_cli_init("crm_error");
43 crm_set_options(NULL, "[options] -- rc", long_options,
44 "Tool for displaying the textual description of a reported error code");
45
46 while (flag >= 0) {
47 flag = crm_get_option(argc, argv, &option_index);
48 switch (flag) {
49 case -1:
50 break;
51 case 'V':
52 crm_bump_log_level(argc, argv);
53 break;
54 case '$':
55 case '?':
56 crm_help(flag, EX_OK);
57 break;
58 default:
59 crm_help(flag, EX_OK);
60 break;
61 }
62 }
63
64 for(lpc = optind; lpc < argc; lpc++) {
65 rc = crm_atoi(argv[lpc], NULL);
66 printf("%s\n", pcmk_strerror(rc));
67 }
68 return 0;
69}

Callers

nothing calls this directly

Calls 6

crm_log_cli_initFunction · 0.85
crm_set_optionsFunction · 0.85
crm_get_optionFunction · 0.85
crm_bump_log_levelFunction · 0.85
crm_helpFunction · 0.85
pcmk_strerrorFunction · 0.85

Tested by

no test coverage detected