| 64 | } |
| 65 | |
| 66 | int |
| 67 | main(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; |
nothing calls this directly
no test coverage detected