Giter Site home page Giter Site logo

grepyang's People

Contributors

ariel-anieli avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

grepyang's Issues

Inner block matches more brackets than it should

For example,

# ./grepyang input cancel-commit [email protected]
853:  rpc cancel-commit {
862:    input {
863:      leaf persist-id {
864:        type string;
865:        description
866:          "This parameter is given in order to cancel a persistent
867:           confirmed commit.  The value must be equal to the value
868:           given in the 'persist' parameter to the <commit> operation.
869:           If it does not match, the operation fails with an
870:          'invalid-value' error.";
871:      }
872:    }
872:    }
873:  }

Lines 872 come back twice; they should not.

Print outer node, though inner node not found

YANG does contain the inner node

# ./grepyang cancel-commit '[email protected]'
853:  rpc cancel-commit {
854:    if-feature confirmed-commit;
855:    description
856:      "This operation is used to cancel an ongoing confirmed commit.
857:       If the confirmed commit is persistent, the parameter
858:       'persist-id' must be given, and it must match the value of the
859:       'persist' parameter.";
860:    reference "RFC 6241, Section 8.4.4.1";
861:
862:    input {
863:      leaf persist-id {
864:        type string;
865:        description
866:          "This parameter is given in order to cancel a persistent
867:           confirmed commit.  The value must be equal to the value
868:           given in the 'persist' parameter to the <commit> operation.
869:           If it does not match, the operation fails with an
870:          'invalid-value' error.";
871:      }
872:    }
873:  }

Still, if the inner block does not exist, the outer node comes out, blank:

# ./grepyang output cancel-commit '[email protected]'
853:  rpc cancel-commit {
873:  }

For block found withing block, no line numbering

This fix solves this issue, but remove the line numbers from output:

# ./grepyang input cancel-commit '[email protected]'
  rpc cancel-commit {
    input {
      leaf persist-id {
        type string;
        description
          "This parameter is given in order to cancel a persistent
           confirmed commit.  The value must be equal to the value
           given in the 'persist' parameter to the <commit> operation.
           If it does not match, the operation fails with an
          'invalid-value' error.";
      }
    }
  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.