003 File Manager
Current Path:
/usr/src/contrib/libxo/libxo
usr
/
src
/
contrib
/
libxo
/
libxo
/
📁
..
📄
Makefile.am
(1.9 KB)
📄
add.man.in
(523 B)
📄
gen-wide.sh
(1.01 KB)
📄
libxo.3
(8.18 KB)
📄
libxo.c
(205.77 KB)
📄
xo.h
(18.36 KB)
📄
xo_attr.3
(1.88 KB)
📄
xo_buf.h
(3.54 KB)
📄
xo_create.3
(1.59 KB)
📄
xo_emit.3
(2.92 KB)
📄
xo_emit_err.3
(2 KB)
📄
xo_emit_f.3
(3.27 KB)
📄
xo_encoder.c
(8.97 KB)
📄
xo_encoder.h
(5.46 KB)
📄
xo_err.3
(1.97 KB)
📄
xo_error.3
(1.06 KB)
📄
xo_explicit.h
(2.1 KB)
📄
xo_finish.3
(1.05 KB)
📄
xo_flush.3
(1.01 KB)
📄
xo_format.5
(33.64 KB)
📄
xo_humanize.h
(5.02 KB)
📄
xo_message.3
(2.02 KB)
📄
xo_no_setlocale.3
(1.12 KB)
📄
xo_open_container.3
(4.85 KB)
📄
xo_open_list.3
(4.77 KB)
📄
xo_open_marker.3
(3.22 KB)
📄
xo_options.7
(4.06 KB)
📄
xo_parse_args.3
(3.77 KB)
📄
xo_set_allocator.3
(1.33 KB)
📄
xo_set_flags.3
(3.48 KB)
📄
xo_set_info.3
(2.61 KB)
📄
xo_set_options.3
(944 B)
📄
xo_set_style.3
(1.47 KB)
📄
xo_set_syslog_enterprise_id.3
(1.06 KB)
📄
xo_set_version.3
(1.09 KB)
📄
xo_set_writer.3
(1.48 KB)
📄
xo_syslog.3
(2.32 KB)
📄
xo_syslog.c
(19.3 KB)
📄
xo_wcwidth.h
(13.69 KB)
Editing: xo_parse_args.3
.\" # .\" # Copyright (c) 2014, Juniper Networks, Inc. .\" # All rights reserved. .\" # This SOFTWARE is licensed under the LICENSE provided in the .\" # ../Copyright file. By downloading, installing, copying, or .\" # using the SOFTWARE, you agree to be bound by the terms of that .\" # LICENSE. .\" # Phil Shafer, July 2014 .\" .Dd December 4, 2014 .Dt LIBXO 3 .Os .Sh NAME .Nm xo_parse_args , xo_set_program .Nd detect, parse, and remove arguments for libxo .Sh LIBRARY .Lb libxo .Sh SYNOPSIS .In libxo/xo.h .Ft int .Fn xo_parse_args "int argc" "char **argv" .Ft int .Fn xo_set_program "const char *name" .Sh DESCRIPTION The .Fn xo_parse_args function is used to process command-line arguments. .Nm libxo specific options are processed and removed from the argument list so the calling application does not need to process them. If successful, a new value for argc is returned. On failure, a message it emitted and -1 is returned. .Bd -literal -offset indent argc = xo_parse_args(argc, argv); if (argc < 0) exit(EXIT_FAILURE); .Ed .Pp Following the call to .Fn xo_parse_args , the application can process the remaining arguments in a normal manner. .Pp .Nm libxo uses command line options to trigger rendering behavior. The following options are recognised: .Pp .Bl -tag -width "--libxo" .It \-\^\-libxo <options> .It \-\^\-libxo=<options> .It \-\^\-libxo:<brief-options> .El .Pp Options is a comma-separated list of tokens that correspond to output styles, flags, or features: .Pp .Bl -tag -width "12345678" .It Sy "Token Action" .It Dv dtrt Enable "Do The Right Thing" mode .It Dv html Emit HTML output .It Dv indent=xx Set the indentation level .It Dv info Add info attributes (HTML) .It Dv json Emit JSON output .It Dv keys Emit the key attribute for keys (XML) .It Dv log-gettext Log (via stderr) each .Xr gettext 3 string lookup .It Dv log-syslog Log (via stderr) each syslog message (via .Xr xo_syslog 3 ) .If Dv no-humanize Ignore the {h:} modifier (TEXT, HTML) .It Dv no-locale Do not initialize the locale setting .It Dv no-retain Prevent retaining formatting information .It Dv no-top Do not emit a top set of braces (JSON) .It Dv not-first Pretend the 1st output item was not 1st (JSON) .It Dv pretty Emit pretty-printed output .It Dv retain Force retaining formatting information .It Dv text Emit TEXT output .If Dv underscores Replace XML-friendly "-"s with JSON friendly "_"s e .It Dv units Add the 'units' (XML) or 'data-units (HTML) attribute .It Dv warn Emit warnings when libxo detects bad calls .It Dv warn-xml Emit warnings in XML .It Dv xml Emit XML output .It Dv xpath Add XPath expressions (HTML) .El .Pp The .Dq brief-options are single letter commands, designed for those with too little patience to use real tokens. No comma separator is used. .Bl -column "i<num>" .It Sy "Token Action" .It "H " "Enable HTML output (XO_STYLE_HTML)" .It "I " "Enable info output (XOF_INFO)" .It "i<num> " "Indent by <number>" .It "J " "Enable JSON output (XO_STYLE_JSON)" .It "P " "Enable pretty-printed output (XOF_PRETTY)" .It "T " "Enable text output (XO_STYLE_TEXT)" .It "W " "Enable warnings (XOF_WARN)" .It "X " "Enable XML output (XO_STYLE_XML)" .It "x " "Enable XPath data (XOF_XPATH)" .El .Pp The .Fn xo_set_program function sets name of the program as reported by functions like .Fn xo_failure , .Fn xo_warn , .Fn xo_err , etc. The program name is initialized by .Fn xo_parse_args , but subsequent calls to .Fn xo_set_program can override this value. .Pp Note that the value is not copied, so the memory passed to .Fn xo_set_program (and .Fn xo_parse_args ) must be maintained by the caller. .Pp .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 .Sh HISTORY The .Nm libxo library first appeared in .Fx 11.0 . .Sh AUTHORS .Nm libxo was written by .An Phil Shafer Aq Mt phil@freebsd.org .
Upload File
Create Folder