summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2020-03-05 11:47:41 -0500
committerDave Barach <openvpp@barachs.net>2020-03-06 13:53:19 +0000
commit5e0e0df9b494bb9ef698533db42f2ea496046a32 (patch)
treeae5f28a48ef92d6e9aa6cbc23096b0c62e4c2c32 /docs
parentfb8ed8b95529db095b7305938db17a545ca9eeef (diff)
docs: document the unformat '%_' option
Type: docs Change-Id: Id864fcff768a78aa313b193f2eaabe545d95bec4 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/gettingstarted/developers/infrastructure.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/gettingstarted/developers/infrastructure.md b/docs/gettingstarted/developers/infrastructure.md
index 12f96d5ad41..e50972d7dc1 100644
--- a/docs/gettingstarted/developers/infrastructure.md
+++ b/docs/gettingstarted/developers/infrastructure.md
@@ -278,6 +278,20 @@ The phrase "bitzero %|" means "set the specified bit in the supplied
bitmask" if unformat parses "bitzero". Although it looks like it could
be fairly handy, it's very lightly used in the code base.
+`%_` toggles whether or not to skip input white space.
+
+For transition from skip to no-skip in middle of format string, skip input white space. For example, the following:
+
+```c
+fmt = "%_%d.%d%_->%_%d.%d%_"
+unformat (input, fmt, &one, &two, &three, &four);
+```
+matches input "1.2 -> 3.4".
+Without this, the space after -> does not get skipped.
+
+
+```
+
### How to parse a single input line
Debug CLI command functions MUST NOT accidentally consume input