lasercat

command
v0.0.0-...-3738d89 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: MIT Imports: 10 Imported by: 0

README

lasercat

STOP USING THIS START USING JQ

DOWNLOAD HERE

LASERCATS

Ok I'm done now.

lasercat pulls a specific target from JSON input.

Usage

$ lasercat --help
Usage of lasercat:
  -target value
    	locations to pluck from input (default [])

Simple Example

$ echo '{"everything":"awesome","team":{"everything":"cool"}}'|go run lasercat.go -target "everything" -target "team","everything"
awesome cool

Complex Example

{
  "menu": {
    "id": "file",
    "value": "File",
    "popup": {
      "menuitem": [
        {
          "value": "New",
          "onclick": "CreateNewDoc()"
        },
        {
          "value": "Open",
          "onclick": "OpenDoc()"
        },
        {
          "value": "Close",
          "onclick": "CloseDoc()"
        }
      ]
    }
  }
}
$  cat exampleData|lasercat -target "menu","id" -target "menu","popup","menuitem",1,"onclick"
file OpenDoc()

Invalid Position

If you give a target that does not exist within given JSON input, you will get an error.

⇒  cat exampleData|lasercat -target "menu","id" -target "menu","popup","menuitem",1,"oncllick"
2015/10/27 05:48:29 non-existant map position

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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