hclgrep

package module
v0.0.0-...-fcb78d3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MIT Imports: 5 Imported by: 0

README

Grep your HCL files

hclgrep is a grep(1) like utility that allows to pass a very simple pattern and will output the range (line,column) in which the HCL block is defined. Passing an additional -v flag will make it print the block where that pattern is found.

It currently only accepts a pattern for checking if a block, label, or attribute is found. Future versions might include matching for attribute values.

Installation

If you have Go set up in your machine, just run:

go install github.com/inkel/hclgrep@latest

Usage

hclgrep [-v] <pattern> [path]

License

MIT. See LICENSE.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPattern = errors.New("invalid pattern")

Functions

func Grep

func Grep(pattern string, src []byte, file string) ([]hcl.Range, error)

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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