Skip to content

Commit d7a3f9f

Browse files
committed
doc UPDATE yanglint man file
1 parent 1d6a111 commit d7a3f9f

File tree

1 file changed

+121
-57
lines changed

1 file changed

+121
-57
lines changed

tools/lint/yanglint.1

Lines changed: 121 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.\" groff -man -Tascii yanglint.1
44
.\"
55

6-
.TH YANGLINT 1 "2016-10-27" "libyang"
6+
.TH YANGLINT 1 "2025-8-19" "libyang"
77
.SH NAME
88
yanglint \- YANG lint tool
99
.
@@ -32,74 +32,138 @@ complex way.
3232
.SH OPTIONS
3333
.TP
3434
.BR "\-h\fR,\fP \-\^\-help"
35-
Outputs usage help and exits.
35+
Show this help message and exit.
3636
.TP
3737
.BR "\-v\fR,\fP \-\^\-version"
38-
Outputs the version number and exits.
38+
Show version number and exit.
3939
.TP
4040
.BR "\-V\fR,\fP \-\^\-verbose"
41-
Increases the verbosity level. If not specified, only errors are printed, with
42-
each appearance it adds: warnings, verbose messages, debug messages (if compiled
43-
with debug information).
41+
Increase libyang verbosity and show verbose messages. If specified a second time, show even debug messages.
4442
.TP
45-
.BR "\-p \fIPATH\fP\fR,\fP \-\^\-path=\fIPATH\fP"
46-
Specifies search path for getting imported modules or included submodules. The option
47-
can be used multiple times. The current working directory and path of the module
48-
being added is used implicitly.
49-
.TP
50-
.BR "\-s\fR,\fP \-\^\-strict"
51-
Changes handling of unknown data nodes - instead of silently ignoring unknown data,
52-
error is printed and data parsing fails. This option applies only on data parsing.
43+
.BR "\-Q\fR,\fP \-\^\-quiet"
44+
Decrease libyang verbosity and hide warnings. If specified a second time, hide errors so no libyang messages are printed.
5345
.TP
5446
.BR "\-f \fIFORMAT\fP\fR,\fP \-\^\-format=\fIFORMAT\fP"
55-
Converts the content of the input \fIFILE\fPs into the specified \fIFORMAT\fP. If no
56-
\fIOUTFILE\fP is specified, the data are printed on the standard output. Only the
57-
compatible formats for the input \fIFILE\fPs are allowed, see the section \fBFORMATS\fP.
47+
Convert input into FORMAT. Supported formats: yang, yin, tree, info and feature-param for schemas, xml, json, and lyb for data.
5848
.TP
59-
.BR "\-o \fIOUTFILE\fP\fR,\fP \-\^\-output=\fIOUTFILE\fP"
60-
Writes the output data into the specified \fIOUTFILE\fP. The option can be used
61-
only in combination with \fB--format\fR option. In case of converting schema, only
62-
a single input schema \fIFILE\fP is allowed. In case of data input \fIFILE\fPs,
63-
input is merged and printed into a single \fIOUTFILE\fP.
49+
.BR "\-I \fIFORMAT\fP\fR,\fP \-\^\-in\-format=\fIFORMAT\fP"
50+
Load the data in one of the following formats: xml, json, lyb. If input format not specified, it is detected from the
51+
file extension.
52+
.TP
53+
.BR "\-p \fIPATH\fP\fR,\fP \-\^\-path=\fIPATH\fP"
54+
Search path for schema (YANG/YIN) modules. The option can be used multiple times. The current working directory and the
55+
path of the module being added is used implicitly. Subdirectories are also searched.
56+
.TP
57+
.BR "\-D\fR,\fP \-\^\-siable\-searchdir"
58+
Do not implicitly search in current working directory for schema modules. If specified a second time, do not even
59+
search in the module directory (all modules must be explicitly specified).
6460
.TP
6561
.BR "\-F \fIFEATURES\fP\fR,\fP \-\^\-features=\fIFEATURES\fP"
66-
Specifies the list of enabled features in the format
67-
\fIMODULE\fP:[\fIFEATURE\fP,...]. In case of processing multiple modules, the
68-
option can be used repeatedly. To disable all the features, use an empty list
69-
specified for the particular module.
62+
Specific module features to support in the form <module-name>:(<feature>,)*
63+
Use <feature> '*' to enable all features of a module. This option can be specified multiple times, to enable features
64+
in multiple modules. If this option is not specified, all the features in all the implemented modules are enabled.
7065
.TP
71-
.BR "\-d \fIMODE\fP\fR,\fP \-\^\-default=\fIMODE\fP"
72-
Print data with default values, according to the \fIMODE\fP (to print attributes,
73-
the ietf-netconf-with-defaults model must be loaded). The \fIMODE\fP is one of the following:
74-
\[bu] \fBall\fP - add missing default nodes
75-
\[bu] \fBall-tagged\fP - add missing default nodes and mark all the default nodes with the attribute
76-
\[bu] \fBtrim\fP - remove all nodes with a default value
77-
\[bu] \fBimplicit-tagged\fP - add missing nodes and mark them with the attribute
66+
.BR "\-i\fR,\fP \-\^\-make\-implemented"
67+
Make the imported modules referenced from any loaded module also implemented. If specified a second time, all the
68+
modules are set implemented.
69+
.TP
70+
.BR "\-P \fIPATH\fP\fR,\fP \-\^\-schema\-node=\fIPATH\fP"
71+
Print only the specified subtree of the schema. The PATH is the XPath subset mentioned in documentation as the Path
72+
format. The option can be combined with \-\^\-single-node option to print information only about the specified node.
73+
.TP
74+
.BR "\-q\fR,\fP \-\^\-single\-node"
75+
Supplement to the \-\^\-schema-node option to print information only about a single node specified as PATH argument.
76+
.TP
77+
.BR "\-s \fISUBMODULE\fP\fR,\fP \-\^\-submodule=\fISUBMODULE\fP"
78+
Print the specific submodule instead of the main module.
79+
.TP
80+
.BR "\-x \fIFILE\fP\fR,\fP \-\^\-ext\-data=\fIFILE\fP"
81+
File containing the specific data required by an extension. Required by the schema-mount extension, for example, when
82+
the operational data are expected in the file. File format is guessed.
83+
.TP
84+
.BR "\-n\fR,\fP \-\^\-not\-strict"
85+
Do not require strict data parsing (silently skip unknown data), has no effect for schemas.
86+
.TP
87+
.BR "\-e\fR,\fP \-\^\-present"
88+
Validate only with the schema modules whose data actually exist in the provided input data files. Takes effect only
89+
with the 'data' or 'config' TYPEs. Used to avoid requiring mandatory nodes from modules which data are not present in
90+
the provided input data files.
7891
.TP
7992
.BR "\-t \fITYPE\fP\fR,\fP \-\^\-type=\fITYPE\fP"
8093
Specify data tree type in the input data \fIFILE\fPs. The \fITYPE\fP is one of the following:
81-
\[bu] \fBauto\fP - Resolve data type (one of the following) automatically (as pyang does). Applicable only on XML input data.
82-
\[bu] \fBdata\fP - Complete datastore with status data (default type).
83-
\[bu] \fBconfig\fP - Configuration datastore (without status data).
84-
\[bu] \fBget\fP - Result of the NETCONF <get> operation.
85-
\[bu] \fBgetconfig\fP - Result of the NETCONF <get-config> operation.
86-
\[bu] \fBedit\fP - Content of the NETCONF <edit-config> operation.
87-
\[bu] \fBrpc\fP - Content of the NETCONF <rpc> message, defined as YANG's rpc input statement.
88-
\[bu] \fBrpcreply\fP - Reply to the RPC. This is just a virtual \fITYPE\fP, for parsing replies, '\fBauto\fP' must be used since the data \fIFILE\fPs are expected in pairs.
89-
.br
90-
The first input data \fIFILE\fP is expected as '\fBrpc\fP' \fITYPE\fP, the second \fIFILE\fP is expected as reply to the previous RPC.
91-
\[bu] \fBnotif\fP - Notification instance (content of the <notification> element without <eventTime>.
92-
.TP
93-
.BR "\-O \fIFILE\fP\fR,\fP \-\^\-operational=\fIFILE\fP]
94-
Optional parameter for '\fBrpc\fP' and '\fBnotif\fP' \fITYPE\fPs, the \fIFILE\fP contains running configuration datastore and
95-
state data referenced from the RPC/Notification. The same data apply to all input data \fIFILE\fPs. Note that the file
96-
is validated as '\fBdata\fP' \fITYPE\fP. Special value '\fB!\fP' can be used as \fIFILE\fP argument to ignore the external references.
97-
.TP
98-
.BR "\-y \fIYANGLIB_PATH\fP"
99-
Specify path to a yang-library data file (XML or JSON) describing the initial context.
100-
If provided, yanglint loads the modules according to the content of the yang-library data tree.
101-
Otherwise, an empty content with only the internal libyang modules is used. This does
102-
not limit user to load another modules explicitly specified as command line parameters.
94+
\[bu] \fBdata\fP - Complete (operational) datastore with state data (default).
95+
\[bu] \fBconfig\fP - Configuration datastore (without state data).
96+
\[bu] \fBget\fP - Result of the NETCONF <get> operation.
97+
\[bu] \fBgetconfig\fP - Result of the NETCONF <get-config> operation.
98+
\[bu] \fBedit\fP - Content of the NETCONF <edit-config> operation.
99+
\[bu] \fBrpc\fP - Content of the NETCONF <rpc> message, defined as YANG's rpc input statement.
100+
\[bu] \fBnc-rpc\fP - Similar to 'rpc' but expect and check also the NETCONF envelopes <rpc> or <action>.
101+
\[bu] \fBreply\fP - Reply to the RPC/Action. Note that the reply data are expected inside a container
102+
representing the original RPC/Action. This is necessary to identify appropriate
103+
data definitions in the schema module.
104+
\[bu] \fBnc-reply\fP - Similar to 'reply' but expect and check also the NETCONF envelope <rpc-reply> with
105+
output data nodes as direct descendants. The original RPC/action invocation is expected"
106+
in a separate parameter '-R' and is parsed as 'nc-rpc'.
107+
\[bu] \fBnotif\fP - Notification instance (content of the <notification> element without <eventTime>).
108+
\[bu] \fBnc-notif\fP - Similar to 'notif' but expect and check also the NETCONF envelope <notification> with
109+
element <eventTime> and its sibling as the actual notification.
110+
\[bu] \fBext\fP - Validates extension data based on loaded YANG modules. Need to be used with -k parameter.
111+
.TP
112+
.BR "\-d \fIMODE\fP\fR,\fP \-\^\-default=\fIMODE\fP"
113+
Print data with default values, according to the MODE (to print attributes, ietf-netconf-with-defaults model
114+
must be loaded):
115+
\[bu] \fBall\fP - Add missing default nodes.
116+
\[bu] \fBall-tagged\fP - Add missing default nodes and mark all the default nodes with the attribute.
117+
\[bu] \fBtrim\fP - Remove all nodes with a default value.
118+
\[bu] \fBimplicit-tagged\fP - Add missing nodes and mark them with an attribute.
119+
.TP
120+
.BR "\-E \fIXPATH\fP\fR,\fP \-\^\-data\-xpath=\fIXPATH\fP"
121+
Evaluate XPATH expression over the data and print the nodes satisfying the expression. The output format is specific
122+
and the option cannot be combined with the -f and -d options. Also all the data inputs are merged into a single data
123+
tree where the expression is evaluated, so the -m option is always set implicitly.
124+
.TP
125+
.BR "\-l\fR,\fP \-\^\-list"
126+
Print info about the loaded schemas. (i - imported module, I - implemented module)
127+
In case the '-f' option with data encoding is specified, the list is printed as 'ietf-yang-library' data.
128+
.TP
129+
.BR "\-L \fILINE_LENGTH\fP\fR,\fP \-\^\-tree\-line\-length=\fITREE_LENGTH\fP"
130+
The limit of the maximum line length on which the 'tree' format will try to be printed.
131+
.TP
132+
.BR "\-o \fIOUTFILE\fP\fR,\fP \-\^\-output=\fIOUTFILE\fP"
133+
Write the output to OUTFILE instead of stdout.
134+
.TP
135+
.BR "\-O \fIFILE\fP\fR,\fP \-\^\-operational=\fIFILE\fP"
136+
Provide optional data to extend validation of the '(nc-)rpc', '(nc-)reply' or '(nc-)notif' TYPEs. The FILE is supposed
137+
to contain the operational datastore referenced from the operation. In case of a nested notification or action, its
138+
parent existence is also checked in these operational data.
139+
.TP
140+
.BR "\-R \fIFILE\fP\fR,\fP \-\^\-reply\-rpc=\fIFILE\fP"
141+
Provide source RPC for parsing of the 'nc-reply' TYPE. The FILE is supposed to contain the source 'nc-rpc' operation of
142+
the reply.
143+
.TP
144+
.BR "\-m\fR,\fP \-\^\-merge"
145+
Merge input data files into a single tree and validate at once. The option has effect only for 'data' and 'config' TYPEs.
146+
.TP
147+
.BR "\-y\fR,\fP \-\^\-yang\-library"
148+
Load and implement internal 'ietf-yang-library' YANG module. Note that this module includes definitions of mandatory
149+
state data that can result in unexpected data validation errors.
150+
.TP
151+
.BR "\-Y \fIFILE\fP\fR,\fP \-\^\-yang\-library\-file=\fIFILE\fP"
152+
Parse FILE with 'ietf-yang-library' data and use them to create an exact YANG schema context. If specified, the '-F'
153+
parameter (enabled features) is ignored.
154+
.TP
155+
.BR "\-X\fR,\fP \-\^\-extended\-leafref"
156+
Allow usage of deref() XPath function within leafref
157+
.TP
158+
.BR "\-J\fR,\fP \-\^\-json\-null"
159+
Allow usage of JSON empty values ('null') within input data
160+
.TP
161+
.BR "\-k\fR,\fP \-\^\-ext\-inst"
162+
Name of extension instance in format: <module-name>:<extension-name>:<argument>. Need to be used with -t ext parameter.
163+
.TP
164+
.BR "\-G \fIGROUPS\fP\fR,\fP \-\^\-debug=\fIGROUPS\fP"
165+
Enable printing of specific debugging message group (nothing will be printed unless verbosity is set to debug):
166+
<group>[,<group>]* (dict, xpath, dep-sets)
103167
.
104168
.SH FORMATS
105169
There are two types of formats to use.
@@ -109,7 +173,7 @@ In case of schemas, the content can be converted into the '\fByang\fP', '\fByin\
109173
and '\fBtree\fP' formats. As input, only YANG and YIN files are
110174
accepted. Note, that the corresponding file extension is required.
111175
.TP
112-
.I Data\ \ \
176+
.I Data
113177
In case of YANG modeled data, the content can be converted between '\fBxml\fP'
114178
and '\fBjson\fP' formats. Remember that the corresponding file extension of the
115179
input file is required.
@@ -133,4 +197,4 @@ https://github.com/CESNET/libyang (libyang homepage and Git repository)
133197
Radek Krejci <[email protected]>, Michal Vasko <[email protected]>
134198
.
135199
.SH COPYRIGHT
136-
Copyright \(co 2015-2017 CESNET, a.l.e.
200+
Copyright \(co 2015 - 2025 CESNET, a.l.e.

0 commit comments

Comments
 (0)