|
NAMExo —
emit formatted output based on format string and arguments
SYNOPSIS
DESCRIPTIONThexo utility allows command line access to the
functionality of the libxo library. Using
xo , shell scripts can emit XML,
JSON, or HTML using the same commands that
emit text output.
The xo "The {k:name} weighs {:weight/%d} pounds.\n" fish 6 TEXT: The fish weighs 6 pounds. XML: <name>fish</name> <weight>6</weight> JSON: "name": "fish", "weight": 6 HTML: <div class="line"> <div class="text">The </div> <div class="data" data-tag="name">fish</div> <div class="text"> weighs </div> <div class="data" data-tag="weight">6</div> <div class="text"> pounds.</div> </div> The xo --wrap top/a/b/c '{:tag}' value XML: <top> <a> <b> <c> <tag>value</tag> </c> </b> </a> </top> JSON: "top": { "a": { "b": { "c": { "tag": "value" } } } } The #!/bin/sh xo --open top/data xo --depth 2 '{tag}' value xo --close top/data XML: <top> <data> <tag>value</tag> </data> </top> JSON: "top": { "data": { "tag": "value" } } EXAMPLE% xo 'The {:product} is {:status}0 stereo "in route" The stereo is in route % xo -p -X 'The {:product} is {:status}0 stereo "in route" <product>stereo</product> <status>in route</status> SEE ALSOlibxo(3), xo_emit(3)ADDITIONAL DOCUMENTATIONFreeBSD useslibxo version
0.6.1. Complete documentation can be found on github:
http://juniper.github.io/libxo/0.6.1/libxo-manual.html
https://github.com/Juniper/libxo The latest release of https://github.com/Juniper/libxo/releases HISTORYThelibxo library was added in FreeBSD
11.0.
AUTHORPhil Shafer
Visit the GSP FreeBSD Man Page Interface. |