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

Function main

tools/test.iso8601.c:66–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66int
67main(int argc, char **argv)
68{
69 int rc = 0;
70 int argerr = 0;
71 int flag;
72 int index = 0;
73 int print_options = 0;
74 crm_time_t *duration = NULL;
75 crm_time_t *date_time = NULL;
76 crm_time_period_t *interval = NULL;
77
78 const char *period_s = NULL;
79 const char *duration_s = NULL;
80 const char *date_time_s = NULL;
81 const char *expected_s = NULL;
82
83 crm_log_cli_init("iso8601");
84 crm_set_options(NULL, "command [output modifier] ", long_options,
85 "Display and parse ISO8601 dates and times");
86
87 if (argc < 2) {
88 argerr++;
89 }
90
91 while (1) {
92 flag = crm_get_option(argc, argv, &index);
93 if (flag == -1)
94 break;
95
96 switch (flag) {
97 case 'V':
98 crm_bump_log_level(argc, argv);
99 break;
100 case '?':
101 case '$':
102 crm_help(flag, 0);
103 break;
104 case 'n':
105 date_time_s = "now";
106 break;
107 case 'd':
108 date_time_s = optarg;
109 break;
110 case 'p':
111 period_s = optarg;
112 break;
113 case 'D':
114 duration_s = optarg;
115 break;
116 case 'E':
117 expected_s = optarg;
118 break;
119 case 'S':
120 print_options |= crm_time_epoch;
121 break;
122 case 's':
123 print_options |= crm_time_seconds;

Callers

nothing calls this directly

Calls 14

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
crm_time_newFunction · 0.85
crm_time_parse_durationFunction · 0.85
crm_time_parse_periodFunction · 0.85
log_time_periodFunction · 0.85
crm_time_addFunction · 0.85
crm_time_as_stringFunction · 0.85
safe_str_neqFunction · 0.85

Tested by

no test coverage detected