lusingander / geezer

Command line application to format data containing parentheses

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

geezer

Command line application to format data containing parentheses

Installation

$ go install github.com/lusingander/geezer@latest

(require Go 1.19+)

Usage

$ echo "Foo(bar=Bar(baz={n=1,m=2},qux=Qux(name=qqq,value=[1,2,3])))" | geezer
Foo(
  bar = Bar(
    baz = {
      n = 1,
      m = 2
    },
    qux = Qux(
      name = qqq,
      value = [
        1,
        2,
        3
      ]
    )
  )
)

Options

  -n int
        indent width (default 2)
  -s string
        characters with spaces before and after (default "=")

For exapmle:

$ echo "foo:{bar:{n:1,m:2}}" | go run main.go -n 1 -s ":" 
foo : {
 bar : {
  n : 1,
  m : 2
 }
}

License

MIT

About

Command line application to format data containing parentheses

License:MIT License


Languages

Language:Go 100.0%