2 .\" # Copyright (c) 2014, 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 detect, parse, and remove arguments for libxo
21 .Fn xo_parse_args "int argc" "char **argv"
25 function is used to process command-line arguments.
27 options are processed and removed
28 from the argument list so the calling application does not
29 need to process them. If successful, a new value for argc
30 is returned. On failure, a message it emitted and -1 is returned.
31 .Bd -literal -offset indent
32 argc = xo_parse_args(argc, argv);
39 the application can process the remaining arguments in a normal manner.
42 uses command line options to trigger rendering behavior. The
43 following options are recognised:
45 .Bl -tag -width "--libxo"
51 \-\^\-libxo:<brief-options>
54 Options is a comma-separated list of tokens that correspond to output
55 styles, flags, or features:
57 .Bl -tag -width "12345678"
60 Enable "Do The Right Thing" mode
64 Set the indentation level
66 Add info attributes (HTML)
70 Emit the key attribute for keys (XML)
72 Do not initialize the locale setting
74 Do not emit a top set of braces (JSON)
76 Pretend the 1st output item was not 1st (JSON)
78 Emit pretty-printed output
82 Add the 'units' (XML) or 'data-units (HTML) attribute
84 Emit warnings when libxo detects bad calls
90 Add XPath expressions (HTML)
95 are single letter commands, designed for those with
96 too little patience to use real tokens. No comma separator is used.
99 .It "H " "Enable HTML output (XO_STYLE_HTML)"
100 .It "I " "Enable info output (XOF_INFO)"
101 .It "i<num> " "Indent by <number>"
102 .It "J " "Enable JSON output (XO_STYLE_JSON)"
103 .It "P " "Enable pretty-printed output (XOF_PRETTY)"
104 .It "T " "Enable text output (XO_STYLE_TEXT)"
105 .It "W " "Enable warnings (XOF_WARN)"
106 .It "X " "Enable XML output (XO_STYLE_XML)"
107 .It "x " "Enable XPath data (XOF_XPATH)"
110 .Sh ADDITIONAL DOCUMENTATION
112 Complete documentation can be found on github:
113 .Bd -literal -offset indent
114 http://juniper.github.io/libxo/libxo-manual.html
117 libxo lives on github as:
118 .Bd -literal -offset indent
119 https://github.com/Juniper/libxo
122 The latest release of libxo is available at:
123 .Bd -literal -offset indent
124 https://github.com/Juniper/libxo/releases
131 library was added in FreeBSD 11.0.