uint64_t h;
uint64_t w;
} dimensions;
+
+ // Interval
+ struct {
+ const char* since;
+ const char* until;
+ } interval;
} td_client_ctx;
enum {
OPT_FORMAT = 1,
OPT_HEIGHT = 2,
OPT_WIDTH = 3,
+ OPT_SINCE = 4,
+ OPT_UNTIL = 5,
};
static struct argp_option options[] = {
{ "format", OPT_FORMAT, "FORMAT", 0, "Output Format", 0 },
{ "height", OPT_HEIGHT, "PIXELS", 0, "Height of the output image", 1 },
{ "width", OPT_WIDTH, "PIXELS", 0, "Width of the output image", 1 },
+
+ // Time
+ { "since", OPT_SINCE, "TIMESTAMP", 0, "Start the graph from the specified date", 0 },
+ { "until", OPT_UNTIL, "TIMESTAMP", 0, "End the graph at the specified date", 0 },
{ NULL },
};
break;
+ case OPT_SINCE:
+ ctx->interval.since = arg;
+ break;
+
+ case OPT_UNTIL:
+ ctx->interval.until = arg;
+ break;
+
// Called for each argument
case ARGP_KEY_ARG:
// Take the graph name as first argument