sgrep

command module
v0.0.0-...-483f6cb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

README

sgrep

Structural grep

Motivation

When you want to grep some information from a structured document, like code, configuration file, the result may disapoint you:

$ grep mockito pom.xml --color
    <mockito-all.version>1.9.0</mockito-all.version>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>${mockito-all.version}</version>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>

Lack of context makes the results hard to read.

Try sgrep:

$ sgrep mockito pom.xmlpom.xml
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <properties>
 889:     <mockito-all.version>1.9.0>/mockito-all.version>
        </properties>
        <dependencyManagement>
          <dependencies>
            <dependency>
1325:         <groupId>org.mockito>/groupId>
1326:         <artifactId>mockito-all>/artifactId>
1327:         <version>${mockito-all.version}>/version>
            </dependency>
          </dependencies>
        </dependencyManagement>
        <dependencies>
          <dependency>
1360:       <groupId>org.mockito>/groupId>
1361:       <artifactId>mockito-all>/artifactId>
          </dependency>
        </dependencies>
      </project>

sgrep analyze the structure of the document and give enough hierarchical context to let you know the position of the match text.

LICENSE

Apache License V2

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
go
xml

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL