/BashHereDoc

Golang library and small bhd tool to extract bash (bourne-again shell) Here Documents content

Primary LanguageGoApache License 2.0Apache-2.0

BashHereDoc

Go Report Card GoDoc Apache 2.0 License codecov Build Status

This project is a very simple and tiny library for parsing bash-like (bourne-again shell) heredoc syntax. Heredoc (Bash Here Documents) is bash built-in functionality. You can read more about it here Also this project includes a CLI executable bhd to extract doc here contents.

##bhd

bhd is a tool like a grep to extract bash here document contents

###Usage

Usage of ./bhd [file1, file2, ...]:
    -a    list all HereDocument contents
    -t string
        get here document by token. If token is not provided, the first heredoc occurrence is returned
        
    If no arguments are provided, standard input will be used instead

###How to build bhd

Just in the project directory type: $ make build

Or directly with go: $ go build -o bhd cmd/main.go