3  CLI Reference

The yangdiff-pro program uses command line interface (CLI) parameters to control program behavior.

The following sections document all the YumaPro CLI parameters relevant to this program, in alphabetical order.

3.1  --config

The --config parameter specifies the name of a YumaPro configuration file that contains more parameters to process, in addition to the CLI parameters.

Refer to the 'Configuration Files' section for details on the format of this file.

 

--config parameter

 

Syntax

string: complete file specification of the text file to parse for more parameters.

Default:

/etc/yuma/yangdiff-pro.conf

Min Allowed:

0

Max Allowed:

1

Supported by:

netconfd-pro
yangcli-pro
yangdiff-pro
yangdump-pro

Example:

yangdiff-pro --old=test1
  --new=test1a \
  --config=~/testconf.conf

 

3.2  --difftype

The --difftype parameter controls how differences are displayed in the yangdiff-pro program..

The allowed values are 'terse', 'normal', and 'revision'.

 

The basic report format is:

 

 

[add/delete/modify] field-name [field-value]

 

 

The 'terse' option will include the names of the top-level fields that are different.  The actual differences for modification lines ('M') are not printed.

 

 

M typedef C

D container test-D1

D leaf test-D

M container test33

 

 

The 'normal' option will  include any changes for any nested fields or objects.  A brief description of the changes made in a modification line ('M') are printed.  This is the default reporting mode.

 

 

M typedef C

   M type

      M range from 'min .. 41 | 45' to 'min .. 41'

D container test-D1

D leaf test-D

M container test33

   D presence 'not a top-level mand...'

   M choice f

      M case f1

         M leaf f1

            A if-feature 'X'

 

 

The 'revision' option will generate the differences report in YANG revision-stmt format.  For example:

 

 

  revision 2009-09-10 {

      description "

         - Changed typedef C

            - Changed type

               - Changed range from 'min .. 41 | 45' to 'min .. 41'

         - Removed container test-D1

         - Removed leaf test-D

         - Changed container test33

            - Removed presence 'not a top-level mand...'

            - Changed choice f

               - Changed case f1

                  - Changed leaf f1

                     - Added if-feature 'X'

      ";

   }

 

 

difftype parameter

 

Syntax

enumeration:
 terse
 normal
 revision

Default:

normal

Min Allowed:

0

Max Allowed:

1

Supported by:

yangdiff-pro

Example:

yangdiff-pro \          --difftype=revision --new=test3a  \
--old=~test3

 

3.3  --feature-disable

The --feature-disable parameter directs all programs to disable a specific feature.

This parameter is a formatted string containing a module name, followed by a colon ':', followed by a feature name:

 

 

test:feature1

 

 

It is an error if a --feature-enable and --feature-disable parameter specify the same feature.

Parameters for unknown features will be ignored.

 

--feature-disable parameter

 

Syntax

formatted string (module:feature

Default:

none

Min Allowed:

0

Max Allowed:

unlimited

Supported by:

yangcli-pro
yangdiff-pro
yangdump-pro
netconfd-pro

Example:

yangdiff-pro  --format=c \
   --feature-disable=test:feature1 \
   --module=test

 

3.4  --feature-enable

The --feature-enable parameter directs all programs to enable a specific feature.

This parameter is a formatted string containing a module name, followed by a colon ':', followed by a feature name:

 

 

test:feature1

 

 

It is an error if a --feature-disable and --feature-enable parameter specify the same feature.

Parameters for unknown features will be ignored.

 

--feature-enable parameter

 

Syntax

formatted string (module:feature

Default:

none

Min Allowed:

0

Max Allowed:

unlimited

Supported by:

yangcli-pro
yangdiff-pro
yangdump-pro
netconfd-pro

Example:

yangdiff-pro  \
   --feature-enable=test:feature1 \
   --old=test --new=test-new

 

3.5  --feature-enable-default

The --feature-enable-default parameter controls how yangdump-pro will generate C code for YANG features by default.

If 'true', then by default, features will be enabled.

If 'false', then by default, features will be disabled.

If a --feature-enable or --feature-disable parameter is present for a specific feature, then this parameter will be ignored for that feature.

 

--feature-enable-default parameter

 

Syntax

boolean (true or false)

Default:

TRUE

Min Allowed:

0

Max Allowed:

1

Supported by:

yangcli-pro
yangdiff-pro
yangdump-pro
netconfd-pro

Example:

yangdiff-pro \
  --feature-enable-default=false

 

3.6  --header

The --header parameter controls whether YANG header contents will be compared in the yangdiff-pro program.

 

--header parameter

 

Syntax

boolean (true or false)

Default:

TRUE

Min Allowed:

0

Max Allowed:

1

Supported by:

yangdiff-pro

Example:

yangdiff-pro --header=false \
 --old=~/saved-modules \
 -- new=~/work

 

3.7  --help

The --help parameter causes program help text to be printed, and then the program will exit instead of running as normal.

This parameter can be combined with the --help-mode parameter to control the verbosity of the help text.  Use --brief for less, and --full for more than the normal verbosity.

This parameter can be combined with the --version parameter in all programs.  It can also be combined with the --show-errors parameter in yangdump-pro.

The program configuration parameters will be displayed in alphabetical order, not in schema order.

 

--help parameter

 

Syntax

empty

Default:

none

Min Allowed:

0

Max Allowed:

1

Supported by:

netconfd-pro
yangcli-pro
yangdiff-pro
yangdump-pro

Example:

yangdiff-pro --help

 

3.8  --help-mode

The --help-mode parameter is used to control the amount of detail printed when help text is requested in some command.  It is always used with another command, and makes no sense by itself.  It is ignored unless used with the --help parameter.

--help-mode parameter

 

Syntax

choice of 3 empty leafs

  --brief
 --normal
 --full

Default:

normal

Min Allowed:

0

Max Allowed:

1

Supported by:

netconfd-pro
yangcli-pro
yangdiff-pro
yangdump-pro

Example:

yangdiff-pro --help --help-mode=full

 

 

3.9  --home

The --home parameter over-rides the $HOME environment variable, if it is set.  File searches that use the user's home directory will use this path specification instead.  

 

--home parameter

 

Syntax

string: pathspec

Default:

$HOME environment value

Min Allowed:

0

Max Allowed:

1

Supported by:

netconfd-pro
yangcli-pro
yangdiff-pro
yangdump-pro

Example:

yangdiff-pro --home=~/testmodules

 

3.10  --indent

The --indent parameter specifies the number of spaces that will be used to add to the indentation level, each time a child node is printed during program operation.

--indent parameter

 

Syntax

uint32 (0 .. 9)

Default:

2

Min Allowed:

0

Max Allowed:

1

Supported by:

netconfd-pro
yangcli-pro
yangdiff-pro
yangdump-pro

Example:

yangcli-pro --indent=4

 

3.11  --log

The --log parameter specifies a file name to be used for logging program messages, instead of STDOUT.  It can be used with the optional parameters below to control how the log file is written.

 

--log parameter

 

Syntax

string: log file specification

Default:

none

Min Allowed:

0

Max Allowed:

1

Supported by:

netconfd-pro
yangcli-pro
yangdiff-pro
yangdump-pro

Example:

netconfd-pro --log=~/server.log&

 

3.12  --log-append

The --log-append parameter specifies that the existing log file (if any) should be appended , instead of deleted.  It is ignored unless the --log parameter is present.

 

--log-append parameter

 

Syntax

empty

Default:

none

Min Allowed:

0

Max Allowed:

1

Supported by:

netconfd-pro
yangcli-pro
yangdiff-pro
yangdump-pro

Example:

netconfd-pro --log-append \
 --log=~/server.log &

 

3.13  --log-level

The --log-level parameter controls the verbosity level of messages printed to the log file or STDOUT, if no log file is specified.

The log levels are incremental, meaning that each higher level includes everything from the previous level, plus additional messages.

There are 7 settings that can be used:

 

log-level parameter

 

Syntax

enumeration:
 off
 error
 warn
 info
 debug
 debug2
 debug3
 debug4

Default:

--info (--debug for DEBUG builds)

Min Allowed:

0

Max Allowed:

1

Supported by:

netconfd-pro
yangcli-pro
yangdiff-pro
yangdump-pro

Example:

netconfd-pro --log-level=debug \
 --log=~/server.log&

 

3.14  --modpath

The --modpath parameter specifies the YANG module search path to use while searching for YANG files.  It consists of a colon (':') separated list of path specifications, commonly found in Unix, such as the $PATH environment variable.

This parameter overrides the $YUMAPRO_MODPATH environment variable, if it is present.

 

--modpath parameter

 

Syntax

string: list of directory specifications

Default:

$YUMAPRO_MODPATH environment variable

Min Allowed:

0

Max Allowed:

1

Supported by:

netconfd-pro
yangcli-pro
yangdiff-pro
yangdump-pro

Example:

yangdiff-pro \
 --modpath=”~/testmodules:~/modules:~/trunk/netconf/modules”

 

3.15  --new

The --new parameter specifies the YANG file or directory containing the new revision to be compared in the yangdiff-pro program.

If this parameter indicates a filename, then it represents the YANG source module name to compare as the newer of the two revisions.

If this parameter indicates a directory (and the 'old' parameter indicates a filename), then it will be used to to search for a file with the same name as the 'new' parameter.

If the 'old' parameter identifies a directory as well (and the 'no-subdirs' parameter is present), then the modules within the 'new' directory will be  compared to files with the same name in the 'old' directory.  

If the --subdirs parameter is ''true'', then all sub-directories within the 'src' directory will also be checked.

If this string begins with a '~' character, then a username is expected to follow or a directory separator character.  If it begins with a '$' character, then an environment variable name is expected to follow.

 

 

~/some/path ==> <my-home-dir>/some/path

~fred/some/path ==> <fred-home-dir>/some/path

$workdir/some/path ==> <workdir-env-var>/some/path

 

 

This parameter must be present unless the --help  or --version parameters are present.

 

--new parameter

 

Syntax

string (module or directory specification. length 1 .. 4095)

Default:

none

Min Allowed:

1

Max Allowed:

1

Supported by:

yangdiff-pro

Example:

yangdiff-pro \
 --new=test3a
 --difftype=terse
 --old=test3\

 

 

 

3.16  --no-config

The --no-config parameter specifies that the default configuration file (/etc/yumapro/yangdiff_pro.conf) should not be loaded, even if it is present.

 

--no-config parameter

 

Syntax

empty

Default:

none

Min Allowed:

0

Max Allowed:

1

Supported by:

netconfd-pro
yangcli-pro
yangdiff-pro
yangdump-pro

Example:

yangdiff-pro --no-config \
--old=x.yang --new=x1.yang

 

3.17  --old

The --old parameter specifies the YANG file or directory containing the older revision to be compared in the yangdiff-pro program.

If this parameter indicates a filename, then it represents the YANG source module name to compare as the older of the two revisions.

If this parameter indicates a directory (and the 'old' parameter indicates a filename), then it will be used to to search for a file with the same name as the 'new' parameter.

If this string begins with a '~' character, then a username is expected to follow or a directory separator character.  If it begins with a '$' character, then an environment variable name is expected to follow.

 

 

~/some/path ==> <my-home-dir>/some/path

~fred/some/path ==> <fred-home-dir>/some/path

$workdir/some/path ==> <workdir-env-var>/some/path

 

 

This parameter must be present unless the --help  or --version parameters are present.

 

--old parameter

 

Syntax

string (module or directory specification. length 1 .. 4095)

Default:

none

Min Allowed:

1

Max Allowed:

1

Supported by:

yangdiff-pro

Example:

yangdiff-pro \
 --old=test3
 --difftype=terse
 --new=test3a\

 

3.18  --output

The --output parameter specifies where the output files generated by the program will be stored.

 

 

 

~/some/path ==> <my-home-dir>/some/path

 

~fred/some/path ==> <fred-home-dir>/some/path

 

$workdir/some/path ==> <workdir-env-var>/some/path

 

 

--output parameter

 

Syntax

string (path or file specification)

Default:

none

Min Allowed:

0

Max Allowed:

1

Supported by:

yangdump-pro
yangdiff-pro

Example:

yangdiff-pro  \
 --output=~/diff-files

 

3.19  --subdirs

The --subdirs parameter controls whether sub-directories should be searched or not, if they are found during a module search.

If false, the file search paths for modules, scripts, and data files will not include sub-directories if they exist in the specified path.

 

--subdirs parameter

 

Syntax

boolean

Default:

TRUE

Min Allowed:

0

Max Allowed:

1

Supported by:

yangdiff-pro

yangdump-pro

Example:

yangiff  \
 --subdirs=false \
 --subtree=/testpath

 

3.20  --version

The --version parameter causes the program version string to be printed, and then the program will exit instead of running as normal.

All YumaPro version strings use the same format:

DEBUG: <major>.<minor>.<svn-build-version>

or

NON-DEBUG: <major>.<minor>-<release>

An example version number that may be printed:

 

 

yangdiff-pro  2.0-0

 

 

This parameter can be combined with the --help parameter.

 

--version parameter

 

Syntax

empty

Default:

none

Min Allowed:

0

Max Allowed:

1

Supported by:

netconfd-pro
yangcli-pro
yangdiff-pro
yangdump-pro

Example:

yangdiff-pro  --version

 

3.21  --warn-error

The --warn-error parameter controls whether all warnings are elevated to errors.

If ‘true’ then warnings that are enabled will be elevated to errors for reporting purporses.

If the –warn-off parameter is entered for a specific error, that warning is considered disabled, and will not be elevated to an error.

 

--warn-error parameter

 

Syntax

boolean

Default:

false

Min Allowed:

0

Max Allowed:

1

Supported by:

netconfd-pro
yangcli-pro
yangdiff-pro
yangdump-pro

Example:

yangdiff-pro --warn-error=true

 

3.22  --warn-idlen

The --warn-idlen parameter controls whether identifier length warnings will be generated.

The value zero disables all identifier length checking.  If non-zero, then a warning will be generated if an identifier is defined which has a length is greater than this amount.

 

--warn-idlen parameter

 

Syntax

uint32: 0 to disable, or 8 .. 1023

Default:

64

Min Allowed:

0

Max Allowed:

1

Supported by:

netconfd-pro
yangcli-pro
yangdiff-pro
yangdump-pro

Example:

yangdiff-pro --warn-idlen=50

 

3.23  --warn-linelen

The --warn-linelen parameter controls whether line length warnings will be generated.

The value zero disables all line length checking.  If non-zero, then a warning will be generated if a YANG file line is entered which has a length is greater than this amount.

Tab characters are counted as 8 spaces.

 

--warn-linelen parameter

 

Syntax

uint32: 0 to disable, or 40 .. 4095

Default:

72

Min Allowed:

0

Max Allowed:

1

Supported by:

netconfd-pro
yangcli-pro
yangdiff-pro
yangdump-pro

Example:

yangdiff-pro --warn-linelen=79

 

3.24  --warn-off

The --warn-off parameter suppresses a specific warning number.

The error and warning numbers, and the default messages, can be viewed with the yangdump-pro program by using the --show-errors configuration parameter.

The specific warning message will be disabled for all modules.  No message will be printed and the warning will not count towards the total for that module.

 

--warn-off parameter

 

Syntax

uint32: 400 .. 899

Default:

none

Min Allowed:

0

Max Allowed:

499

Supported by:

netconfd-pro
yangcli-pro
yangdiff-pro
yangdump-pro

Example:

yangdiff-pro  --warn-off=435
# revision order not descending

 

3.25  --warn-up

The --warn-up parameter elevates a specific warning number to an error.

The error and warning numbers, and the default messages, can be viewed with the yangdump-pro program by using the --show-errors configuration parameter.

The specific warning message will be elevated for all modules.  An error message will be printed and the warning will be counted towards the error total for that module.

 

--warn-up parameter

 

Syntax

uint32: 1000 .. 1999

Default:

none

Min Allowed:

0

Max Allowed:

unlimied

Supported by:

netconfd-pro
yangcli-pro
yangdiff-pro
yangdump-pro

Example:

yangdiff-pro --warn-up=1022

 

3.26  --yumapro-home

The --yumapro-home parameter specifies the project directory root to use when searching for files.

If present, this directory location will override the '$YUMAPRO_HOME environment variable, if it is set.  If this parameter is set to a zero-length string, then the $YUMAPRO_HOME environment variable will be ignored.

The following directories are searched when either the $YUMAPRO_HOME environment variable or this parameter is set:

 

yumapro-home parameter

 

Syntax

string: directory specification

Default:

$YUMAPRO_HOME environment variable

Min Allowed:

0

Max Allowed:

1

Supported by:

netconfd-pro
yangcli-pro
yangdiff-pro
yangdump-pro

Example:

yangdiff-pro  \
 --yumapro-home=~/sw/netconf