yangdiff-pro Introduction

The yangdiff-pro program is used to compare two revisions of the same YANG file.

yangdiff-pro Features

The yangdiff-pro program has the following features:

  • The conceptual YANG object trees are compared, not the actual YANG statements.

  • Two separate subtrees of modules can be compared, not just 1 file at a time.

  • The differences report format for differences is easy to read, and can be configured with 2 different levels of verbosity.

  • A YANG revision statement can be automatically generated instead of a list of differences. This will include an English text summary of the differences found.

Starting yangdiff-pro

The current working directory in use when yangdiff-pro is invoked is important. It is most convenient to run yangdiff-pro from a work directory, rather than the installation directory or within the module library.

The yangdiff-pro program can be invoked several ways:

  • To get the current version and exit:

    > yangdiff-pro --version
  • To get program help and exit:

    > yangdiff-pro --help
    > yangdiff-pro --help --brief
    > yangdiff-pro --help --full
  • To compare a new YANG module named 'foo', with an old version named foo.2008-09-01.yang, the following command line can be used

    > yangdiff-pro --old=foo.2008-09-01.yang --new=foo
  • To get all the configuration parameters from a text file named '~/yangdiff-pro-project1.conf':

    > yangdiff-pro --config=~/yangdiff-pro-project1.conf
  • To generate a terse differences report called ~/project-X-diffs.log for the old files in the '/public/project-X/modules' with the new modules in the '~/work' directory:

    > yangdiff-pro --difftype=terse --output=~/project-X-diffs.log \
       --old=/public/project-X/modules --new=/work
  • To generate a revision statement differences to ~/foo-projectX-revision.txt for the '~/work/foo.yang' module, with the old version in the in the '/public/project-X/modules':

    > yangdiff-pro --difftype=revision --output=~/foo-project-X-revision.txt \
       --old=/public/project-X/modules --new=/work/foo.yang

Stopping yangdiff-pro

There is no interactive mode for yangdiff-pro, so there is no need for a command to exit the program.

The Control C character sequence can be used to cancel the yangdiff-pro processing in progress. However, this will leave any partially completed output files in place.

yangdiff-pro Configuration Parameter List

The following configuration parameters are used by yangdiff-pro. Refer to the CLI Reference for more details.

yangdiff-pro CLI Parameters





Specifies the configuration file to use for parameters.


Sets the data file search path.


Specifies the type of differences report that should be output.


Leaf list of features to disable


Specifies a feature that should be enabled


Specifies if a feature should be enabled or disabled by default


Specifies whether the module header data should be compared or not.


Get context-sensitive help, then exit.


Adjust the help output (--brief, or --full).


Override $HOME environment variable


Specifies the indent count to use when writing data.


Specifies the log file to use instead of STDOUT.


Controls whether a log file will be reused or overwritten.


Specifies verbosity level of log message output


Sets the module search path.


Specifies the location of the new revision to compare.


Specifies that the default config file should not be loaded


Specifies the location of the old revision to compare.


Specifies where output files should be generated.


Sets the executable file search path.


Controls whether sub-directories are searched for YANG files.


Prints the program version and then exit.


Controls how identifier lengths are checked.


Treat all warnings as errors


Controls how line lengths are checked.


Suppresses the specified warning number.


Elevates the specified warning number to an error


Specifies the $YUMAPRO_HOME project root to use when searching for files.