Improve gettext support. Stylistic fixes and error handling fixes while

on it.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-02-08 19:26:01 +01:00
parent 215c90cb82
commit 9c4b5c13e6
184 changed files with 1175 additions and 959 deletions

View file

@ -407,7 +407,9 @@ static struct argp_option options[] = {
{"root", 'r', N_("DEVICE_NAME"), 0, N_("Set root device."), 2},
{"debug", 'd', "S", 0, N_("Set debug environment variable."), 2},
{"crypto", 'C', NULL, OPTION_ARG_OPTIONAL, N_("Mount crypto devices."), 2},
{"zfs-key", 'K', N_("FILE|prompt"), 0, N_("Load zfs crypto key."), 2},
{"zfs-key", 'K',
/* TRANSLATORS: "prompt" is a keyword. */
N_("FILE|prompt"), 0, N_("Load zfs crypto key."), 2},
{"verbose", 'v', NULL, OPTION_ARG_OPTIONAL, N_("print verbose messages."), 2},
{0, 0, 0, 0, 0, 0}
};
@ -449,13 +451,18 @@ argp_parser (int key, char *arg, struct argp_state *state)
f = fopen (arg, "rb");
if (!f)
{
printf (_("Error loading file %s: %s\n"), arg, strerror (errno));
printf (_("%s: error:"), program_name);
printf (_("cannot open `%s': %s"), arg, strerror (errno));
printf ("\n");
return 0;
}
real_size = fread (buf, 1, 1024, f);
if (real_size < 0)
{
printf (_("Error loading file %s: %s\n"), arg, strerror (errno));
printf (_("%s: error:"), program_name);
printf (_("cannot read `%s': %s"), arg,
strerror (errno));
printf ("\n");
fclose (f);
return 0;
}