yangdiff-pro CLI Reference

--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'
    ";
 }
typedef DiffType {
    type enumeration {
        enum terse;
        enum normal;
        enum revision;
    }
    default "normal";
}

leaf difftype {
   type DiffType;
}

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

--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 search for a file with the same name as this parameter.

  • If the --old parameter identifies a directory as well (and the --subdirs parameter is 'false'), 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 this string 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.

leaf new {
    type nt:NcModuleSpec;
}

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

--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 --new parameter indicates a filename), then it will be used 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 this string 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.

leaf old {
    type nt:NcModuleSpec;
}

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