2 .\" # Copyright (c) 2014-2017, Juniper Networks, Inc.
3 .\" # All rights reserved.
4 .\" # This SOFTWARE is licensed under the LICENSE provided in the
5 .\" # ../Copyright file. By downloading, installing, copying, or
6 .\" # using the SOFTWARE, you agree to be bound by the terms of that
8 .\" # Phil Shafer, July 2014
15 .Nd common options for libxo\-based commands
19 allows the rendering of data into
20 various output styles, including
27 uses command line options to trigger rendering behavior.
28 Options are recognised in three forms:
35 \-\-libxo:<brief\-options>
38 The first two forms accept a comma\-separated set of words, detailed
39 below, while the third form accepts a set of letters, also below.
40 The triggered functionality is identical.
41 .Bl -column "Token2341234"
42 .It Sy "Option " "Action"
43 .It "color " "Enable colors/effects for display styles (TEXT, HTML)"
44 .It "flush " "Flush after each emit call"
45 .It "flush\-line " "Flush each line of output"
46 .It "html " "Emit HTML output"
47 .It "indent=xx " "Set the indentation level"
48 .It "info " "Add info attributes (HTML)"
49 .It "json " "Emit JSON output"
50 .It "keys " "Emit the key attribute for keys (XML)"
51 .It "log\-gettext" "Log (via stderr) each gettext(3) string lookup"
52 .It "log\-syslog " "Log (via stderr) each syslog message (via xo_syslog)"
53 .It "no\-humanize" "Ignore the {h:} modifier (TEXT, HTML)"
54 .It "no\-locale " "Do not initialize the locale setting"
55 .It "no\-retain " "Prevent retaining formatting information"
56 .It "pretty " "Emit pretty\-printed output"
57 .It "retain " "Force retaining formatting information"
58 .It "text " "Emit TEXT output"
59 .It "underscores" "Replace XML\-friendly \"\-\"s with JSON friendly \"_\"s"
60 .It "units " "Add the 'units' (XML) or 'data\-units (HTML) attribute"
61 .It "warn " "Emit warnings when libxo detects bad calls"
62 .It "warn\-xml " "Emit warnings in XML"
63 .It "xml " "Emit XML output"
64 .It "xpath " "Add XPath expressions (HTML)"
67 The brief options are a set of single\-letter aliases for the longer
68 terms, used as a single string:
69 .Bl -column "Value" "Equivalent Token"
70 .It Sy "Value" "Equivalent Token"
73 .It "F " "flush\-line"
76 .It "i<num>" "indent=<num>"
79 .It "n " "no\-humanize"
89 Most of these option are simple and direct, but some require
93 performs line buffering, even when the output is not directed to
97 generates additional data for HTML, encoded in attributes using
98 names that state with "data\-".
101 adds a "key" attribute for XML output to indicate that a leaf is
102 an identifier for the list member.
105 avoids "humanizing" numeric output (see
106 .Xr humanize_number 3
112 to avoid translating output to the current locale.
115 disables the ability of
117 to internally retain "compiled" information about formatting strings.
124 names with dashes into
126 name with underscores.
131 to emit warnings on stderr when application code make incorrect calls.
132 .Fa warn\-xml causes those warnings to be placed in
136 The following are three example invocations of
139 ps \-\-libxo json,pretty,warn \-ux
141 ps \-\-libxo=xml \-lg
151 library first appeared in
156 .An Phil Shafer Aq Mt phil@freebsd.org .