-/*
- * We are _not_ using POPT_ARG_STRING ability to store directly into
- * variables, because we want to cast the return to non-const, which is
- * not possible without using poptGetOptArg explicitly. This helps us
- * controlling memory allocation correctly without making assumptions
- * about undocumented behaviors. poptGetOptArg is documented as
- * requiring the returned const char * to be freed by the caller.
- */
-static struct poptOption long_options[] = {
- /* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
- { "output", 'w', POPT_ARG_STRING, NULL, OPT_OUTPUT_PATH, NULL, NULL },
- { "input-format", 'i', POPT_ARG_STRING, NULL, OPT_INPUT_FORMAT, NULL, NULL },
- { "output-format", 'o', POPT_ARG_STRING, NULL, OPT_OUTPUT_FORMAT, NULL, NULL },
- { "help", 'h', POPT_ARG_NONE, NULL, OPT_HELP, NULL, NULL },
- { "list", 'l', POPT_ARG_NONE, NULL, OPT_LIST, NULL, NULL },
- { "verbose", 'v', POPT_ARG_NONE, NULL, OPT_VERBOSE, NULL, NULL },
- { "debug", 'd', POPT_ARG_NONE, NULL, OPT_DEBUG, NULL, NULL },
- { "names", 'n', POPT_ARG_STRING, NULL, OPT_NAMES, NULL, NULL },
- { "fields", 'f', POPT_ARG_STRING, NULL, OPT_FIELDS, NULL, NULL },
- { "no-delta", 0, POPT_ARG_NONE, NULL, OPT_NO_DELTA, NULL, NULL },
- { "clock-offset", 0, POPT_ARG_STRING, NULL, OPT_CLOCK_OFFSET, NULL, NULL },
- { "clock-offset-ns", 0, POPT_ARG_STRING, NULL, OPT_CLOCK_OFFSET_NS, NULL, NULL },
- { "clock-cycles", 0, POPT_ARG_NONE, NULL, OPT_CLOCK_CYCLES, NULL, NULL },
- { "clock-seconds", 0, POPT_ARG_NONE, NULL, OPT_CLOCK_SECONDS, NULL, NULL },
- { "clock-date", 0, POPT_ARG_NONE, NULL, OPT_CLOCK_DATE, NULL, NULL },
- { "clock-gmt", 0, POPT_ARG_NONE, NULL, OPT_CLOCK_GMT, NULL, NULL },
- { "clock-force-correlate", 0, POPT_ARG_NONE, NULL, OPT_CLOCK_FORCE_CORRELATE, NULL, NULL },
- { NULL, 0, 0, NULL, 0, NULL, NULL },
-};
-
-static void list_formats(FILE *fp)
-{
- fprintf(fp, "\n");
- bt_fprintf_format_list(fp);