path: root/src/startstop.c
authorSergey Poznyakoff <>2013-04-26 14:18:53 (GMT)
committer Sergey Poznyakoff <>2013-04-26 14:48:21 (GMT)
commit699ba6cd496d8401959a0581a1d49c448d3f3c7c (patch) (side-by-side diff)
treee576553ef6531cdf7b1f9b375036f9dd28f2332d /src/startstop.c
parentaf02bbe4ab84ddd6a5ec8da3bab0fa360e8bded2 (diff)
Improve ID mapping.
* doc/eclat.conf.5: Update. * src/cmdline.opt: New option --no-translate (-X) * src/config.c (eclat_kw): New statement: translate. * src/eclat.c (main): override the value of translation_enabled from the command line. * src/eclat.h (translate_option): Rename to translation_enabled. All uses changed. (MAP_IMAGE,MAP_INSTANCE) (MAP_GROUPID,MAP_GROUPNAME) (MAP_SNAPSHOT,MAP_VOLUME) (MAP_AZ,MAP_REG): New defines, to use instead of literal map names. All sources updated accordingly. * src/util.c (translate_option): Rename to translation_enabled. (translate_ids): It is not an error if the name is not found in the map. Use it as the resource ID in that case.
Diffstat (limited to 'src/startstop.c') (more/less context) (ignore whitespace changes)
1 files changed, 1 insertions, 1 deletions
diff --git a/src/startstop.c b/src/startstop.c
index 7ffb5bb..fa36ed7 100644
--- a/src/startstop.c
+++ b/src/startstop.c
@@ -32,13 +32,13 @@ start_stop_instance(eclat_command_env_t *env, int argc, char **argv)
struct ec2_query *q = env->query;
char buf[128], *bend;
size_t bs;
if (argc == 0)
die(EX_USAGE, "no instance ids");
- translate_ids(argc, argv, "InstanceId");
+ translate_ids(argc, argv, MAP_INSTANCE);
strcpy(buf, "InstanceId.");
bend = buf + strlen(buf);
bs = sizeof(buf) - strlen(buf);
for (i = 0; i < argc; i++) {
snprintf(bend, bs, "%lu", (unsigned long)(i + 1));

Return to:

Send suggestions and report system problems to the System administrator.