summaryrefslogtreecommitdiff
path: root/coreutils/expr.c
diff options
context:
space:
mode:
authorPere Orga2011-03-31 14:43:25 +0200
committerDenys Vlasenko2011-03-31 14:43:25 +0200
commit34425389e09353a8dacdd6b23a62553f699c544c (patch)
tree4eb2e19685536384748e75af827deca885c9cc0a /coreutils/expr.c
parente3d8d077b7d2e51fed03dc20267eadbe38903b2a (diff)
downloadbusybox-34425389e09353a8dacdd6b23a62553f699c544c.zip
busybox-34425389e09353a8dacdd6b23a62553f699c544c.tar.gz
move help text from include/usage.src.h to coreutils/*.c
Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils/expr.c')
-rw-r--r--coreutils/expr.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/coreutils/expr.c b/coreutils/expr.c
index 04d783f..24e75b5 100644
--- a/coreutils/expr.c
+++ b/coreutils/expr.c
@@ -25,6 +25,41 @@
/* no getopt needed */
+//usage:#define expr_trivial_usage
+//usage: "EXPRESSION"
+//usage:#define expr_full_usage "\n\n"
+//usage: "Print the value of EXPRESSION to stdout\n"
+//usage: "\n"
+//usage: "EXPRESSION may be:\n"
+//usage: " ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2\n"
+//usage: " ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0\n"
+//usage: " ARG1 < ARG2 1 if ARG1 is less than ARG2, else 0. Similarly:\n"
+//usage: " ARG1 <= ARG2\n"
+//usage: " ARG1 = ARG2\n"
+//usage: " ARG1 != ARG2\n"
+//usage: " ARG1 >= ARG2\n"
+//usage: " ARG1 > ARG2\n"
+//usage: " ARG1 + ARG2 Sum of ARG1 and ARG2. Similarly:\n"
+//usage: " ARG1 - ARG2\n"
+//usage: " ARG1 * ARG2\n"
+//usage: " ARG1 / ARG2\n"
+//usage: " ARG1 % ARG2\n"
+//usage: " STRING : REGEXP Anchored pattern match of REGEXP in STRING\n"
+//usage: " match STRING REGEXP Same as STRING : REGEXP\n"
+//usage: " substr STRING POS LENGTH Substring of STRING, POS counted from 1\n"
+//usage: " index STRING CHARS Index in STRING where any CHARS is found, or 0\n"
+//usage: " length STRING Length of STRING\n"
+//usage: " quote TOKEN Interpret TOKEN as a string, even if\n"
+//usage: " it is a keyword like 'match' or an\n"
+//usage: " operator like '/'\n"
+//usage: " (EXPRESSION) Value of EXPRESSION\n"
+//usage: "\n"
+//usage: "Beware that many operators need to be escaped or quoted for shells.\n"
+//usage: "Comparisons are arithmetic if both ARGs are numbers, else\n"
+//usage: "lexicographical. Pattern matches return the string matched between\n"
+//usage: "\\( and \\) or null; if \\( and \\) are not used, they return the number\n"
+//usage: "of characters matched or 0."
+
#include "libbb.h"
#include "xregex.h"