../_images/logo.png

../_images/yangdiff_components_02-02-2022.png

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

:header-rows:1

Parameter

Description

--config

Specifies the configuration file to use for parameters.

--datapath

Sets the data file search path.

--difftype

Specifies the type of differences report that should be output.

--feature-disable

Leaf list of features to disable

--feature-enable

Specifies a feature that should be enabled

--feature-enable-default

Specifies if a feature should be enabled or disabled by default

--header

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

--help

Get context-sensitive help, then exit.

--help-mode

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

--home

Override $HOME environment variable

--indent

Specifies the indent count to use when writing data.

--log

Specifies the log file to use instead of STDOUT.

--log-append

Controls whether a log file will be reused or overwritten.

--log-level

Specifies verbosity level of log message output

--modpath

Sets the module search path.

--new

Specifies the location of the new revision to compare.

--no-config

Specifies that the default config file should not be loaded

--old

Specifies the location of the old revision to compare.

--output

Specifies where output files should be generated.

--runpath

Sets the executable file search path.

--subdirs

Controls whether sub-directories are searched for YANG files.

--version

Prints the program version and then exit.

--warn-idlen

Controls how identifier lengths are checked.

--warn-error

Treat all warnings as errors

--warn-linelen

Controls how line lengths are checked.

--warn-off

Suppresses the specified warning number.

--warn-up

Elevates the specified warning number to an error

--yumapro-home

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