aboutsummaryrefslogtreecommitdiff
path: root/usage.c
diff options
context:
space:
mode:
Diffstat (limited to 'usage.c')
-rw-r--r--usage.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/usage.c b/usage.c
index 91064f52c..05913f3e3 100644
--- a/usage.c
+++ b/usage.c
@@ -250,6 +250,44 @@ const char echo_usage[] =
250 ; 250 ;
251#endif 251#endif
252 252
253#if defined BB_EXPR
254const char expr_usage[] =
255 "expr EXPRESSION\n"
256#ifndef BB_FEATURE_TRIVIAL_HELP
257 "\nPrints the value of EXPRESSION to standard output.\n\n"
258 "EXPRESSION may be:\n"
259 "ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2\n"
260 "ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0\n"
261 "ARG1 < ARG2 ARG1 is less than ARG2\n"
262 "ARG1 <= ARG2 ARG1 is less than or equal to ARG2\n"
263 "ARG1 = ARG2 ARG1 is equal to ARG2\n"
264 "ARG1 != ARG2 ARG1 is unequal to ARG2\n"
265 "ARG1 >= ARG2 ARG1 is greater than or equal to ARG2\n"
266 "ARG1 > ARG2 ARG1 is greater than ARG2\n"
267 "ARG1 + ARG2 arithmetic sum of ARG1 and ARG2\n"
268 "ARG1 - ARG2 arithmetic difference of ARG1 and ARG2\n"
269 "ARG1 * ARG2 arithmetic product of ARG1 and ARG2\n"
270 "ARG1 / ARG2 arithmetic quotient of ARG1 divided by ARG2\n"
271 "ARG1 % ARG2 arithmetic remainder of ARG1 divided by ARG2\n"
272 "STRING : REGEXP anchored pattern match of REGEXP in STRING\n"
273 "match STRING REGEXP same as STRING : REGEXP\n"
274 "substr STRING POS LENGTH substring of STRING, POS counted from 1\n"
275 "index STRING CHARS index in STRING where any CHARS is found, or 0\n"
276 "length STRING length of STRING\n"
277 "quote TOKEN interpret TOKEN as a string, even if it is a \n"
278 " keyword like `match' or an operator like `/'\n"
279 "( EXPRESSION ) value of EXPRESSION\n\n"
280 "Beware that many operators need to be escaped or quoted for shells.\n"
281 "Comparisons are arithmetic if both ARGs are numbers, else\n"
282 "lexicographical. Pattern matches return the string matched between \n"
283 "\\( and \\) or null; if \\( and \\) are not used, they return the number \n"
284 "of characters matched or 0.\n"
285
286#endif
287 ;
288#endif
289
290
253#if defined BB_TRUE_FALSE 291#if defined BB_TRUE_FALSE
254const char false_usage[] = 292const char false_usage[] =
255 "false\n" 293 "false\n"