aboutsummaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c
index b718486..82033d3 100644
--- a/src/config.c
+++ b/src/config.c
@@ -96,6 +96,34 @@ cb_region(enum grecs_callback_command cmd,
return 0;
}
+static int
+cb_format(enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
+ void *varptr,
+ grecs_value_t *value,
+ void *cb_data)
+{
+ struct ec2_param *p, key;
+ int install = 1;
+
+ if (cmd != grecs_callback_set_value) {
+ grecs_error(locus, 0, "Unexpected block statement");
+ return 1;
+ }
+ if (!value || value->type != GRECS_TYPE_ARRAY || value->v.arg.c != 2) {
+ grecs_error(locus, 0, "expected two strings");
+ return 1;
+ }
+ if (value->v.arg.v[0]->type != GRECS_TYPE_STRING ||
+ value->v.arg.v[1]->type != GRECS_TYPE_STRING) {
+ grecs_error(locus, 0, "expected two strings");
+ return 1;
+ }
+ define_format(value->v.arg.v[0]->v.string,
+ value->v.arg.v[1]->v.string,
+ &value->v.arg.v[1]->locus);
+}
+
static struct grecs_keyword eclat_kw[] = {
{ "default-endpoint", "hostname",
"Set default EC2 endpoint",
@@ -109,7 +137,9 @@ static struct grecs_keyword eclat_kw[] = {
{ "default-region", "name",
"Define default AWS region",
grecs_type_string, GRECS_DFLT, &region_name },
-
+ { "format", "<command: string> <format: string>",
+ "Set default format for the <command>",
+ grecs_type_string, GRECS_MULT, NULL, 0, cb_format },
{ NULL }
};

Return to:

Send suggestions and report system problems to the System administrator.