From 6437aa08d4e4f621a16a040714b2d7b409131a77 Mon Sep 17 00:00:00 2001 From: Craig Small Date: Fri, 11 Oct 2013 10:07:10 +1100 Subject: [PATCH] Update options to single strings To assist the translators, each option is a separate string. This means if we add/change/delete an option the remaining ones will just keep working and only the impacted option needs some translation work on it. --- pgrep.c | 47 +++++++++++++++++++++++------------------------ sysctl.c | 36 ++++++++++++++++++------------------ tload.c | 4 ++-- vmstat.c | 18 +++++++++--------- w.c | 17 +++++++++++------ 5 files changed, 63 insertions(+), 59 deletions(-) diff --git a/pgrep.c b/pgrep.c index 94a2cbe1..6290ec5e 100644 --- a/pgrep.c +++ b/pgrep.c @@ -104,33 +104,32 @@ static int __attribute__ ((__noreturn__)) usage(int opt) fprintf(fp, _(" %s [options] \n"), program_invocation_short_name); fputs(USAGE_OPTIONS, fp); if (i_am_pkill == 0) { - fputs(_(" -d, --delimiter specify output delimiter\n" - " -l, --list-name list PID and process name\n" - " -v, --inverse negates the matching\n" - " -w, --lightweight list all TID\n" - ), fp); + fputs(_(" -d, --delimiter specify output delimiter\n"),fp); + fputs(_(" -l, --list-name list PID and process name\n"),fp); + fputs(_(" -v, --inverse negates the matching\n"),fp); + fputs(_(" -w, --lightweight list all TID\n"), fp); } if (i_am_pkill == 1) { - fputs(_(" -, --signal signal to send (either number or name)\n" - " -e, --echo display what is killed\n"), fp); + fputs(_(" -, --signal signal to send (either number or name)\n"), fp); + fputs(_(" -e, --echo display what is killed\n"), fp); } - fputs(_(" -c, --count count of matching processes\n" - " -f, --full use full process name to match\n" - " -g, --pgroup match listed process group IDs\n" - " -G, --group match real group IDs\n" - " -n, --newest select most recently started\n" - " -o, --oldest select least recently started\n" - " -P, --parent match only child processes of the given parent\n" - " -s, --session match session IDs\n" - " -t, --terminal match by controlling terminal\n" - " -u, --euid match by effective IDs\n" - " -U, --uid match by real IDs\n" - " -x, --exact match exactly with the command name\n" - " -F, --pidfile read PIDs from file\n" - " -L, --logpidfile fail if PID file is not locked\n" - " --ns match the processes that belong to the same\n" - " namespace as \n" - " --nslist list which namespaces will be considered for\n" + fputs(_(" -c, --count count of matching processes\n"), fp); + fputs(_(" -f, --full use full process name to match\n"), fp); + fputs(_(" -g, --pgroup match listed process group IDs\n"), fp); + fputs(_(" -G, --group match real group IDs\n"), fp); + fputs(_(" -n, --newest select most recently started\n"), fp); + fputs(_(" -o, --oldest select least recently started\n"), fp); + fputs(_(" -P, --parent match only child processes of the given parent\n"), fp); + fputs(_(" -s, --session match session IDs\n"), fp); + fputs(_(" -t, --terminal match by controlling terminal\n"), fp); + fputs(_(" -u, --euid match by effective IDs\n"), fp); + fputs(_(" -U, --uid match by real IDs\n"), fp); + fputs(_(" -x, --exact match exactly with the command name\n"), fp); + fputs(_(" -F, --pidfile read PIDs from file\n"), fp); + fputs(_(" -L, --logpidfile fail if PID file is not locked\n"), fp); + fputs(_(" --ns match the processes that belong to the same\n" + " namespace as \n"), fp); + fputs(_(" --nslist list which namespaces will be considered for\n" " the --ns option.\n" " Available namespaces: ipc, mnt, net, pid, user, uts\n"), fp); fputs(USAGE_SEPARATOR, fp); diff --git a/sysctl.c b/sysctl.c index ca3992ee..bb3e6b73 100644 --- a/sysctl.c +++ b/sysctl.c @@ -105,24 +105,24 @@ static void __attribute__ ((__noreturn__)) _(" %s [options] [variable[=value] ...]\n"), program_invocation_short_name); fputs(USAGE_OPTIONS, out); - fputs(_(" -a, --all display all variables\n" - " -A alias of -a\n" - " -X alias of -a\n" - " --deprecated include deprecated parameters to listing\n" - " -b, --binary print value without new line\n" - " -e, --ignore ignore unknown variables errors\n" - " -N, --names print variable names without values\n" - " -n, --values print only values of a variables\n" - " -p, --load[=] read values from file\n" - " -f alias of -p\n" - " --system read values from all system directories\n" - " -r, --pattern \n" - " select setting that match expression\n" - " -q, --quiet do not echo variable set\n" - " -w, --write enable writing a value to variable\n" - " -o does nothing\n" - " -x does nothing\n" - " -d alias of -h\n"), out); + fputs(_(" -a, --all display all variables\n"), out); + fputs(_(" -A alias of -a\n"), out); + fputs(_(" -X alias of -a\n"), out); + fputs(_(" --deprecated include deprecated parameters to listing\n"), out); + fputs(_(" -b, --binary print value without new line\n"), out); + fputs(_(" -e, --ignore ignore unknown variables errors\n"), out); + fputs(_(" -N, --names print variable names without values\n"), out); + fputs(_(" -n, --values print only values of a variables\n"), out); + fputs(_(" -p, --load[=] read values from file\n"), out); + fputs(_(" -f alias of -p\n"), out); + fputs(_(" --system read values from all system directories\n"), out); + fputs(_(" -r, --pattern \n" + " select setting that match expression\n"), out); + fputs(_(" -q, --quiet do not echo variable set\n"), out); + fputs(_(" -w, --write enable writing a value to variable\n"), out); + fputs(_(" -o does nothing\n"), out); + fputs(_(" -x does nothing\n"), out); + fputs(_(" -d alias of -h\n"), out); fputs(USAGE_SEPARATOR, out); fputs(USAGE_HELP, out); fputs(USAGE_VERSION, out); diff --git a/tload.c b/tload.c index 27c0aefe..680a430c 100644 --- a/tload.c +++ b/tload.c @@ -88,8 +88,8 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out) fprintf(out, _(" %s [options] [tty]\n"), program_invocation_short_name); fputs(USAGE_OPTIONS, out); - fputs(_(" -d, --delay update delay in seconds\n" - " -s, --scale vertical scale\n"), out); + fputs(_(" -d, --delay update delay in seconds\n"), out); + fputs(_(" -s, --scale vertical scale\n"), out); fputs(USAGE_SEPARATOR, out); fputs(USAGE_HELP, out); fputs(USAGE_VERSION, out); diff --git a/vmstat.c b/vmstat.c index 6f95f095..c8ccc876 100644 --- a/vmstat.c +++ b/vmstat.c @@ -87,15 +87,15 @@ static void __attribute__ ((__noreturn__)) _(" %s [options] [delay [count]]\n"), program_invocation_short_name); fputs(USAGE_OPTIONS, out); - fputs(_(" -a, --active active/inactive memory\n" - " -f, --forks number of forks since boot\n" - " -m, --slabs slabinfo\n" - " -n, --one-header do not redisplay header\n" - " -s, --stats event counter statistics\n" - " -d, --disk disk statistics\n" - " -D, --disk-sum summarize disk statistics\n" - " -p, --partition partition specific statistics\n" - " -S, --unit define display unit\n"), out); + fputs(_(" -a, --active active/inactive memory\n"), out); + fputs(_(" -f, --forks number of forks since boot\n"), out); + fputs(_(" -m, --slabs slabinfo\n"), out); + fputs(_(" -n, --one-header do not redisplay header\n"), out); + fputs(_(" -s, --stats event counter statistics\n"), out); + fputs(_(" -d, --disk disk statistics\n"), out); + fputs(_(" -D, --disk-sum summarize disk statistics\n"), out); + fputs(_(" -p, --partition partition specific statistics\n"), out); + fputs(_(" -S, --unit define display unit\n"), out); fputs(USAGE_SEPARATOR, out); fputs(USAGE_HELP, out); fputs(USAGE_VERSION, out); diff --git a/w.c b/w.c index 36ceac38..e04137d3 100644 --- a/w.c +++ b/w.c @@ -236,10 +236,12 @@ static void print_time_ival7(time_t t, int centi_sec, FILE * fout) fprintf(fout, _(" %2ludays"), t / (24 * 60 * 60)); else if (t >= 60 * 60) /* > 1 hour */ + /* Translation Hint: Hours:Minutes */ fprintf(fout, " %2lu:%02u ", t / (60 * 60), (unsigned)((t / 60) % 60)); else if (t > 60) /* > 1 minute */ + /* Translation Hint: Minutes:Seconds */ fprintf(fout, _(" %2lu:%02um"), t / 60, (unsigned)t % 60); else fprintf(fout, " "); @@ -249,12 +251,15 @@ static void print_time_ival7(time_t t, int centi_sec, FILE * fout) fprintf(fout, _(" %2ludays"), t / (24 * 60 * 60)); else if (t >= 60 * 60) /* 1 hour or more */ + /* Translation Hint: Hours:Minutes */ fprintf(fout, _(" %2lu:%02um"), t / (60 * 60), (unsigned)((t / 60) % 60)); else if (t > 60) /* 1 minute or more */ + /* Translation Hint: Minutes:Seconds */ fprintf(fout, " %2lu:%02u ", t / 60, (unsigned)t % 60); else + /* Translation Hint: Seconds:Centiseconds */ fprintf(fout, _(" %2lu.%02us"), t, centi_sec); } } @@ -437,12 +442,12 @@ static void __attribute__ ((__noreturn__)) fprintf(out, _(" %s [options]\n"), program_invocation_short_name); fputs(USAGE_OPTIONS, out); - fputs(_(" -h, --no-header do not print header\n" - " -u, --no-current ignore current process username\n" - " -s, --short short format\n" - " -f, --from show remote hostname field\n" - " -o, --old-style old style output\n" - " -i, --ip-addr display IP address instead of hostname (if possible)\n"), out); + fputs(_(" -h, --no-header do not print header\n"),out); + fputs(_(" -u, --no-current ignore current process username\n"),out); + fputs(_(" -s, --short short format\n"),out); + fputs(_(" -f, --from show remote hostname field\n"),out); + fputs(_(" -o, --old-style old style output\n"),out); + fputs(_(" -i, --ip-addr display IP address instead of hostname (if possible)\n"), out); fputs(USAGE_SEPARATOR, out); fputs(_(" --help display this help and exit\n"), out); fputs(USAGE_VERSION, out);