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.
This commit is contained in:
Craig Small 2013-10-11 10:07:10 +11:00
parent 099bf9a26a
commit 6437aa08d4
5 changed files with 63 additions and 59 deletions

47
pgrep.c
View File

@ -104,33 +104,32 @@ static int __attribute__ ((__noreturn__)) usage(int opt)
fprintf(fp, _(" %s [options] <pattern>\n"), program_invocation_short_name); fprintf(fp, _(" %s [options] <pattern>\n"), program_invocation_short_name);
fputs(USAGE_OPTIONS, fp); fputs(USAGE_OPTIONS, fp);
if (i_am_pkill == 0) { if (i_am_pkill == 0) {
fputs(_(" -d, --delimiter <string> specify output delimiter\n" fputs(_(" -d, --delimiter <string> specify output delimiter\n"),fp);
" -l, --list-name list PID and process name\n" fputs(_(" -l, --list-name list PID and process name\n"),fp);
" -v, --inverse negates the matching\n" fputs(_(" -v, --inverse negates the matching\n"),fp);
" -w, --lightweight list all TID\n" fputs(_(" -w, --lightweight list all TID\n"), fp);
), fp);
} }
if (i_am_pkill == 1) { if (i_am_pkill == 1) {
fputs(_(" -<sig>, --signal <sig> signal to send (either number or name)\n" fputs(_(" -<sig>, --signal <sig> signal to send (either number or name)\n"), fp);
" -e, --echo display what is killed\n"), fp); fputs(_(" -e, --echo display what is killed\n"), fp);
} }
fputs(_(" -c, --count count of matching processes\n" fputs(_(" -c, --count count of matching processes\n"), fp);
" -f, --full use full process name to match\n" fputs(_(" -f, --full use full process name to match\n"), fp);
" -g, --pgroup <id,...> match listed process group IDs\n" fputs(_(" -g, --pgroup <id,...> match listed process group IDs\n"), fp);
" -G, --group <gid,...> match real group IDs\n" fputs(_(" -G, --group <gid,...> match real group IDs\n"), fp);
" -n, --newest select most recently started\n" fputs(_(" -n, --newest select most recently started\n"), fp);
" -o, --oldest select least recently started\n" fputs(_(" -o, --oldest select least recently started\n"), fp);
" -P, --parent <ppid,...> match only child processes of the given parent\n" fputs(_(" -P, --parent <ppid,...> match only child processes of the given parent\n"), fp);
" -s, --session <sid,...> match session IDs\n" fputs(_(" -s, --session <sid,...> match session IDs\n"), fp);
" -t, --terminal <tty,...> match by controlling terminal\n" fputs(_(" -t, --terminal <tty,...> match by controlling terminal\n"), fp);
" -u, --euid <id,...> match by effective IDs\n" fputs(_(" -u, --euid <id,...> match by effective IDs\n"), fp);
" -U, --uid <id,...> match by real IDs\n" fputs(_(" -U, --uid <id,...> match by real IDs\n"), fp);
" -x, --exact match exactly with the command name\n" fputs(_(" -x, --exact match exactly with the command name\n"), fp);
" -F, --pidfile <file> read PIDs from file\n" fputs(_(" -F, --pidfile <file> read PIDs from file\n"), fp);
" -L, --logpidfile fail if PID file is not locked\n" fputs(_(" -L, --logpidfile fail if PID file is not locked\n"), fp);
" --ns <pid> match the processes that belong to the same\n" fputs(_(" --ns <pid> match the processes that belong to the same\n"
" namespace as <pid>\n" " namespace as <pid>\n"), fp);
" --nslist <ns,...> list which namespaces will be considered for\n" fputs(_(" --nslist <ns,...> list which namespaces will be considered for\n"
" the --ns option.\n" " the --ns option.\n"
" Available namespaces: ipc, mnt, net, pid, user, uts\n"), fp); " Available namespaces: ipc, mnt, net, pid, user, uts\n"), fp);
fputs(USAGE_SEPARATOR, fp); fputs(USAGE_SEPARATOR, fp);

View File

@ -105,24 +105,24 @@ static void __attribute__ ((__noreturn__))
_(" %s [options] [variable[=value] ...]\n"), _(" %s [options] [variable[=value] ...]\n"),
program_invocation_short_name); program_invocation_short_name);
fputs(USAGE_OPTIONS, out); fputs(USAGE_OPTIONS, out);
fputs(_(" -a, --all display all variables\n" fputs(_(" -a, --all display all variables\n"), out);
" -A alias of -a\n" fputs(_(" -A alias of -a\n"), out);
" -X alias of -a\n" fputs(_(" -X alias of -a\n"), out);
" --deprecated include deprecated parameters to listing\n" fputs(_(" --deprecated include deprecated parameters to listing\n"), out);
" -b, --binary print value without new line\n" fputs(_(" -b, --binary print value without new line\n"), out);
" -e, --ignore ignore unknown variables errors\n" fputs(_(" -e, --ignore ignore unknown variables errors\n"), out);
" -N, --names print variable names without values\n" fputs(_(" -N, --names print variable names without values\n"), out);
" -n, --values print only values of a variables\n" fputs(_(" -n, --values print only values of a variables\n"), out);
" -p, --load[=<file>] read values from file\n" fputs(_(" -p, --load[=<file>] read values from file\n"), out);
" -f alias of -p\n" fputs(_(" -f alias of -p\n"), out);
" --system read values from all system directories\n" fputs(_(" --system read values from all system directories\n"), out);
" -r, --pattern <expression>\n" fputs(_(" -r, --pattern <expression>\n"
" select setting that match expression\n" " select setting that match expression\n"), out);
" -q, --quiet do not echo variable set\n" fputs(_(" -q, --quiet do not echo variable set\n"), out);
" -w, --write enable writing a value to variable\n" fputs(_(" -w, --write enable writing a value to variable\n"), out);
" -o does nothing\n" fputs(_(" -o does nothing\n"), out);
" -x does nothing\n" fputs(_(" -x does nothing\n"), out);
" -d alias of -h\n"), out); fputs(_(" -d alias of -h\n"), out);
fputs(USAGE_SEPARATOR, out); fputs(USAGE_SEPARATOR, out);
fputs(USAGE_HELP, out); fputs(USAGE_HELP, out);
fputs(USAGE_VERSION, out); fputs(USAGE_VERSION, out);

View File

@ -88,8 +88,8 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
fprintf(out, fprintf(out,
_(" %s [options] [tty]\n"), program_invocation_short_name); _(" %s [options] [tty]\n"), program_invocation_short_name);
fputs(USAGE_OPTIONS, out); fputs(USAGE_OPTIONS, out);
fputs(_(" -d, --delay <secs> update delay in seconds\n" fputs(_(" -d, --delay <secs> update delay in seconds\n"), out);
" -s, --scale <num> vertical scale\n"), out); fputs(_(" -s, --scale <num> vertical scale\n"), out);
fputs(USAGE_SEPARATOR, out); fputs(USAGE_SEPARATOR, out);
fputs(USAGE_HELP, out); fputs(USAGE_HELP, out);
fputs(USAGE_VERSION, out); fputs(USAGE_VERSION, out);

View File

@ -87,15 +87,15 @@ static void __attribute__ ((__noreturn__))
_(" %s [options] [delay [count]]\n"), _(" %s [options] [delay [count]]\n"),
program_invocation_short_name); program_invocation_short_name);
fputs(USAGE_OPTIONS, out); fputs(USAGE_OPTIONS, out);
fputs(_(" -a, --active active/inactive memory\n" fputs(_(" -a, --active active/inactive memory\n"), out);
" -f, --forks number of forks since boot\n" fputs(_(" -f, --forks number of forks since boot\n"), out);
" -m, --slabs slabinfo\n" fputs(_(" -m, --slabs slabinfo\n"), out);
" -n, --one-header do not redisplay header\n" fputs(_(" -n, --one-header do not redisplay header\n"), out);
" -s, --stats event counter statistics\n" fputs(_(" -s, --stats event counter statistics\n"), out);
" -d, --disk disk statistics\n" fputs(_(" -d, --disk disk statistics\n"), out);
" -D, --disk-sum summarize disk statistics\n" fputs(_(" -D, --disk-sum summarize disk statistics\n"), out);
" -p, --partition <dev> partition specific statistics\n" fputs(_(" -p, --partition <dev> partition specific statistics\n"), out);
" -S, --unit <char> define display unit\n"), out); fputs(_(" -S, --unit <char> define display unit\n"), out);
fputs(USAGE_SEPARATOR, out); fputs(USAGE_SEPARATOR, out);
fputs(USAGE_HELP, out); fputs(USAGE_HELP, out);
fputs(USAGE_VERSION, out); fputs(USAGE_VERSION, out);

17
w.c
View File

@ -236,10 +236,12 @@ static void print_time_ival7(time_t t, int centi_sec, FILE * fout)
fprintf(fout, _(" %2ludays"), t / (24 * 60 * 60)); fprintf(fout, _(" %2ludays"), t / (24 * 60 * 60));
else if (t >= 60 * 60) else if (t >= 60 * 60)
/* > 1 hour */ /* > 1 hour */
/* Translation Hint: Hours:Minutes */
fprintf(fout, " %2lu:%02u ", t / (60 * 60), fprintf(fout, " %2lu:%02u ", t / (60 * 60),
(unsigned)((t / 60) % 60)); (unsigned)((t / 60) % 60));
else if (t > 60) else if (t > 60)
/* > 1 minute */ /* > 1 minute */
/* Translation Hint: Minutes:Seconds */
fprintf(fout, _(" %2lu:%02um"), t / 60, (unsigned)t % 60); fprintf(fout, _(" %2lu:%02um"), t / 60, (unsigned)t % 60);
else else
fprintf(fout, " "); 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)); fprintf(fout, _(" %2ludays"), t / (24 * 60 * 60));
else if (t >= 60 * 60) else if (t >= 60 * 60)
/* 1 hour or more */ /* 1 hour or more */
/* Translation Hint: Hours:Minutes */
fprintf(fout, _(" %2lu:%02um"), t / (60 * 60), fprintf(fout, _(" %2lu:%02um"), t / (60 * 60),
(unsigned)((t / 60) % 60)); (unsigned)((t / 60) % 60));
else if (t > 60) else if (t > 60)
/* 1 minute or more */ /* 1 minute or more */
/* Translation Hint: Minutes:Seconds */
fprintf(fout, " %2lu:%02u ", t / 60, (unsigned)t % 60); fprintf(fout, " %2lu:%02u ", t / 60, (unsigned)t % 60);
else else
/* Translation Hint: Seconds:Centiseconds */
fprintf(fout, _(" %2lu.%02us"), t, centi_sec); fprintf(fout, _(" %2lu.%02us"), t, centi_sec);
} }
} }
@ -437,12 +442,12 @@ static void __attribute__ ((__noreturn__))
fprintf(out, fprintf(out,
_(" %s [options]\n"), program_invocation_short_name); _(" %s [options]\n"), program_invocation_short_name);
fputs(USAGE_OPTIONS, out); fputs(USAGE_OPTIONS, out);
fputs(_(" -h, --no-header do not print header\n" fputs(_(" -h, --no-header do not print header\n"),out);
" -u, --no-current ignore current process username\n" fputs(_(" -u, --no-current ignore current process username\n"),out);
" -s, --short short format\n" fputs(_(" -s, --short short format\n"),out);
" -f, --from show remote hostname field\n" fputs(_(" -f, --from show remote hostname field\n"),out);
" -o, --old-style old style output\n" fputs(_(" -o, --old-style old style output\n"),out);
" -i, --ip-addr display IP address instead of hostname (if possible)\n"), out); fputs(_(" -i, --ip-addr display IP address instead of hostname (if possible)\n"), out);
fputs(USAGE_SEPARATOR, out); fputs(USAGE_SEPARATOR, out);
fputs(_(" --help display this help and exit\n"), out); fputs(_(" --help display this help and exit\n"), out);
fputs(USAGE_VERSION, out); fputs(USAGE_VERSION, out);