From b6063de0382e9145df7fdb63383244f68d355243 Mon Sep 17 00:00:00 2001
From: Rob Landley
Date: Sun, 29 Jan 2012 13:54:13 -0600
Subject: Add <>= to lib/args.c, with documentation.
---
www/code.html | 32 ++++++++++++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
(limited to 'www')
diff --git a/www/code.html b/www/code.html
index 541b1019..6eacb40d 100644
--- a/www/code.html
+++ b/www/code.html
@@ -356,7 +356,7 @@ code at compile time via the optimizer's dead code elimination (which removes
from the binary any code that cannot be reached). This saves space without
cluttering the code with #ifdefs or leading to configuration dependent build
breaks. (See the 1992 Usenix paper
-#ifdef
+#ifdef
Considered Harmful for more information.)
USE_SYMBOL(code) evaluates to the code in parentheses when the symbol
@@ -547,8 +547,20 @@ argument letter, indicating the option takes an additional argument:
- : - plus a string argument, keep most recent if more than one.
- * - plus a string argument, appended to a linked list.
-- # - plus a singed long argument. A {LOW,HIGH} range can also be appended to restrict allowed values of argument.
- @ - plus an occurrence counter (stored in a long)
+- # - plus a signed long argument.
+
- . - plus a floating point argument (if CFG_TOYBOX_FLOAT).
+The following can be appended to a float or double:
+- <123 - error if argument is less than this
+- >123 - error if argument is greater than this
+- =123 - default value if argument not supplied
+
+- Option parsing only understands <>= after . when CFG_TOYBOX_FLOAT
+is enabled. (Otherwise the code to determine where floating point constants
+end drops out. When disabled, it can reserve a global data slot for the
+argument so offsets won't change, but will never fill it out.). You can handle
+this by using the USE_BLAH() macros with C string concatenation, ala:
+"abc." USE_TOYBOX_FLOAT("<1.23>4.56=7.89") "def"
Arguments may occur with or without a space (I.E. "-a 42" or "-a42").
@@ -614,6 +626,22 @@ optflag, but letters are never control characters.)
[yz] this option requires at least one of y or z to also be enabled.
+The following may be appended to a float or double:
+
+
+- <123 - error if argument is less than this
+- >123 - error if argument is greater than this
+- =123 - default value if argument not supplied
+
+
+Option parsing only understands <>= after . when CFG_TOYBOX_FLOAT
+is enabled. (Otherwise the code to determine where floating point constants
+end drops out. When disabled, it can reserve a global data slot for the
+argument so offsets won't change, but will never fill it out.). You can handle
+this by using the USE_BLAH() macros with C string concatenation, ala:
+
+"abc." USE_TOYBOX_FLOAT("<1.23>4.56=7.89") "def"
+
--longopts
The optflags string can contain long options, which are enclosed in
--
cgit v1.2.3