diff options
author | Jim Meyering <jim@meyering.net> | 2001-12-15 20:46:30 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2001-12-15 20:46:30 +0000 |
commit | 2fae9e5d26536fc61ad06a3d295c9bb8e40d215e (patch) | |
tree | 95b997f03d6570981ce5d104a4500b6ffd446768 /src/expr.c | |
parent | 9be58099c4347a6bc27609b88b5f3ac8c1e054ac (diff) | |
download | coreutils-2fae9e5d26536fc61ad06a3d295c9bb8e40d215e.tar.xz |
Use new macros, HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION
instead of hard-coding --help and --version descriptions.
Split --help output into smaller pieces.
Use fputs, not printf.
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/expr.c b/src/expr.c index 4003802a9..53a1849f7 100644 --- a/src/expr.c +++ b/src/expr.c @@ -92,19 +92,19 @@ Usage: %s EXPRESSION\n\ or: %s OPTION\n\ "), program_name, program_name); - printf (_("\ -\n\ - --help display this help and exit\n\ - --version output version information and exit\n\ + fputs ("\n", stdout); + fputs (HELP_OPTION_DESCRIPTION, stdout); + fputs (VERSION_OPTION_DESCRIPTION, stdout); + fputs (_("\ \n\ -")); - printf (_("\ Print the value of EXPRESSION to standard output. A blank line below\n\ separates increasing precedence groups. EXPRESSION may be:\n\ \n\ ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2\n\ \n\ ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0\n\ +"), stdout); + fputs (_("\ \n\ ARG1 < ARG2 ARG1 is less than ARG2\n\ ARG1 <= ARG2 ARG1 is less than or equal to ARG2\n\ @@ -112,13 +112,19 @@ separates increasing precedence groups. EXPRESSION may be:\n\ ARG1 != ARG2 ARG1 is unequal to ARG2\n\ ARG1 >= ARG2 ARG1 is greater than or equal to ARG2\n\ ARG1 > ARG2 ARG1 is greater than ARG2\n\ +"), stdout); + fputs (_("\ \n\ ARG1 + ARG2 arithmetic sum of ARG1 and ARG2\n\ ARG1 - ARG2 arithmetic difference of ARG1 and ARG2\n\ +"), stdout); + fputs (_("\ \n\ ARG1 * ARG2 arithmetic product of ARG1 and ARG2\n\ ARG1 / ARG2 arithmetic quotient of ARG1 divided by ARG2\n\ - ARG1 %% ARG2 arithmetic remainder of ARG1 divided by ARG2\n\ + ARG1 % ARG2 arithmetic remainder of ARG1 divided by ARG2\n\ +"), stdout); + fputs (_("\ \n\ STRING : REGEXP anchored pattern match of REGEXP in STRING\n\ \n\ @@ -126,18 +132,20 @@ separates increasing precedence groups. EXPRESSION may be:\n\ substr STRING POS LENGTH substring of STRING, POS counted from 1\n\ index STRING CHARS index in STRING where any CHARS is found, or 0\n\ length STRING length of STRING\n\ +"), stdout); + fputs (_("\ + TOKEN interpret TOKEN as a string, even if it is a\n\ keyword like `match' or an operator like `/'\n\ \n\ ( EXPRESSION ) value of EXPRESSION\n\ -")); - printf (_("\ +"), stdout); + fputs (_("\ \n\ Beware that many operators need to be escaped or quoted for shells.\n\ Comparisons are arithmetic if both ARGs are numbers, else lexicographical.\n\ Pattern matches return the string matched between \\( and \\) or null; if\n\ \\( and \\) are not used, they return the number of characters matched or 0.\n\ -")); +"), stdout); puts (_("\nReport bugs to <bug-sh-utils@gnu.org>.")); } exit (status); |