aboutsummaryrefslogtreecommitdiff
path: root/src/eclat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eclat.c')
-rw-r--r--src/eclat.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/eclat.c b/src/eclat.c
index 8fafc72..a93c7ae 100644
--- a/src/eclat.c
+++ b/src/eclat.c
@@ -367,7 +367,56 @@ compile_default_format(struct command *cmd)
return env;
}
+
+struct filter_descr *available_filters;
+
+static char *aws_typestr[] = {
+ "String",
+ "dateType"
+};
+
+void
+list_filters(FILE *fp)
+{
+ struct filter_descr *flt;
+ size_t ncols = get_scr_cols();
+ size_t col, start;
+ fprintf(fp, "Available filters are:\n");
+ for (flt = available_filters; flt->name; flt++) {
+ col = fprintf(fp, " %-25s", flt->name);
+ if (col > 26) {
+ col = start = 26;
+ fprintf(fp, "\n%*.*s", start, start, "");
+ }
+ if (flt->type != FILTER_ENUM)
+ fprintf(fp, "%s", aws_typestr[flt->type]);
+ else {
+ int i;
+ char *delim;
+ size_t len;
+
+ col += fprintf(fp, "One of:");
+ start = col + 1;
+ delim = " ";
+ for (i = 0; flt->avail[i]; i++) {
+ len = strlen(delim) + strlen(flt->avail[i]);
+ if (col + len >= ncols) {
+ fprintf(fp, ",\n%*.*s",
+ start, start, "");
+ col = start;
+ delim = "";
+ }
+ col += fprintf(fp, "%s%s", delim,
+ flt->avail[i]);
+ delim = ", ";
+ }
+ }
+ fputc('\n', fp);
+ }
+ fputc('\n', fp);
+}
+
int

Return to:

Send suggestions and report system problems to the System administrator.