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
88yanglint \- 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 \fI PATH \fP\fR ,\fP \- \^ \- path=\fI PATH \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 \fI FORMAT \fP\fR ,\fP \- \^ \- format=\fI FORMAT \fP "
55- Converts the content of the input \fI FILE \fP s into the specified \fI FORMAT \fP . If no
56- \fI OUTFILE \fP is specified, the data are printed on the standard output. Only the
57- compatible formats for the input \fI FILE \fP s are allowed, see the section \fB FORMATS \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 \fI OUTFILE \fP\fR ,\fP \- \^ \- output=\fI OUTFILE \fP "
60- Writes the output data into the specified \fI OUTFILE \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 \fI FILE \fP is allowed. In case of data input \fI FILE \fP s,
63- input is merged and printed into a single \fI OUTFILE \fP .
49+ .BR " \- I \fI FORMAT \fP\fR ,\fP \- \^ \- in\- format=\fI FORMAT \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 \fI PATH \fP\fR ,\fP \- \^ \- path=\fI PATH \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 \fI FEATURES \fP\fR ,\fP \- \^ \- features=\fI FEATURES \fP "
66- Specifies the list of enabled features in the format
67- \fI MODULE \fP :[\fI FEATURE \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 \fI MODE \fP\fR ,\fP \- \^ \- default=\fI MODE \fP "
72- Print data with default values, according to the \fI MODE \fP (to print attributes,
73- the ietf-netconf-with-defaults model must be loaded). The \fI MODE \fP is one of the following:
74- \[bu ] \fB all \fP - add missing default nodes
75- \[bu ] \fB all-tagged \fP - add missing default nodes and mark all the default nodes with the attribute
76- \[bu ] \fB trim \fP - remove all nodes with a default value
77- \[bu ] \fB implicit-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 \fI PATH \fP\fR ,\fP \- \^ \- schema\- node=\fI PATH \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 \fI SUBMODULE \fP\fR ,\fP \- \^ \- submodule=\fI SUBMODULE \fP "
78+ Print the specific submodule instead of the main module.
79+ .TP
80+ .BR " \- x \fI FILE \fP\fR ,\fP \- \^ \- ext\- data=\fI FILE \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 \fI TYPE \fP\fR ,\fP \- \^ \- type=\fI TYPE \fP "
8093Specify data tree type in the input data \fI FILE \fP s. The \fI TYPE \fP is one of the following:
81- \[bu ] \fB auto \fP - Resolve data type (one of the following) automatically (as pyang does). Applicable only on XML input data.
82- \[bu ] \fB data \fP - Complete datastore with status data (default type).
83- \[bu ] \fB config \fP - Configuration datastore (without status data).
84- \[bu ] \fB get \fP - Result of the NETCONF <get> operation.
85- \[bu ] \fB getconfig \fP - Result of the NETCONF <get-config> operation.
86- \[bu ] \fB edit \fP - Content of the NETCONF <edit-config> operation.
87- \[bu ] \fB rpc \fP - Content of the NETCONF <rpc> message, defined as YANG's rpc input statement.
88- \[bu ] \fB rpcreply \fP - Reply to the RPC. This is just a virtual \fI TYPE \fP , for parsing replies, '\fB auto \fP ' must be used since the data \fI FILE \fP s are expected in pairs.
89- .br
90- The first input data \fI FILE \fP is expected as '\fB rpc \fP ' \fI TYPE \fP , the second \fI FILE \fP is expected as reply to the previous RPC.
91- \[bu ] \fB notif \fP - Notification instance (content of the <notification> element without <eventTime>.
92- .TP
93- .BR " \- O \fI FILE \fP\fR ,\fP \- \^ \- operational=\fI FILE \fP ]
94- Optional parameter for '\fB rpc \fP ' and '\fB notif \fP ' \fI TYPE \fP s, the \fI FILE \fP contains running configuration datastore and
95- state data referenced from the RPC/Notification. The same data apply to all input data \fI FILE \fP s. Note that the file
96- is validated as '\fB data \fP ' \fI TYPE \fP . Special value '\fB ! \fP ' can be used as \fI FILE \fP argument to ignore the external references.
97- .TP
98- .BR " \- y \fI YANGLIB_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 ] \fB data \fP - Complete (operational) datastore with state data (default).
95+ \[bu ] \fB config \fP - Configuration datastore (without state data).
96+ \[bu ] \fB get \fP - Result of the NETCONF <get> operation.
97+ \[bu ] \fB getconfig \fP - Result of the NETCONF <get-config> operation.
98+ \[bu ] \fB edit \fP - Content of the NETCONF <edit-config> operation.
99+ \[bu ] \fB rpc \fP - Content of the NETCONF <rpc> message, defined as YANG's rpc input statement.
100+ \[bu ] \fB nc-rpc \fP - Similar to 'rpc' but expect and check also the NETCONF envelopes <rpc> or <action>.
101+ \[bu ] \fB reply \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 ] \fB nc-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 ] \fB notif \fP - Notification instance (content of the <notification> element without <eventTime>).
108+ \[bu ] \fB nc-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 ] \fB ext \fP - Validates extension data based on loaded YANG modules. Need to be used with -k parameter.
111+ .TP
112+ .BR " \- d \fI MODE \fP\fR ,\fP \- \^ \- default=\fI MODE \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 ] \fB all \fP - Add missing default nodes.
116+ \[bu ] \fB all-tagged \fP - Add missing default nodes and mark all the default nodes with the attribute.
117+ \[bu ] \fB trim \fP - Remove all nodes with a default value.
118+ \[bu ] \fB implicit-tagged \fP - Add missing nodes and mark them with an attribute.
119+ .TP
120+ .BR " \- E \fI XPATH \fP\fR ,\fP \- \^ \- data\- xpath=\fI XPATH \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 \fI LINE_LENGTH \fP\fR ,\fP \- \^ \- tree\- line\- length=\fI TREE_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 \fI OUTFILE \fP\fR ,\fP \- \^ \- output=\fI OUTFILE \fP "
133+ Write the output to OUTFILE instead of stdout.
134+ .TP
135+ .BR " \- O \fI FILE \fP\fR ,\fP \- \^ \- operational=\fI FILE \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 \fI FILE \fP\fR ,\fP \- \^ \- reply\- rpc=\fI FILE \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 \fI FILE \fP\fR ,\fP \- \^ \- yang\- library\- file=\fI FILE \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 \fI GROUPS \fP\fR ,\fP \- \^ \- debug=\fI GROUPS \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
105169There 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\
109173and '\fB tree \fP ' formats. As input, only YANG and YIN files are
110174accepted. Note, that the corresponding file extension is required.
111175.TP
112- .I Data\ \ \
176+ .I Data
113177In case of YANG modeled data, the content can be converted between '\fB xml \fP '
114178and '\fB json \fP ' formats. Remember that the corresponding file extension of the
115179input file is required.
@@ -133,4 +197,4 @@ https://github.com/CESNET/libyang (libyang homepage and Git repository)
133197134198.
135199.SH COPYRIGHT
136- Copyright \(co 2015-2017 CESNET, a.l.e.
200+ Copyright \(co 2015 - 2025 CESNET, a.l.e.
0 commit comments