json_tool

command module
v0.0.0-...-d339537 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

README

json_tool

a tool for json config file, we could get and set key-values in folders

test.json

{
	"a":"",
	"b":"2"
}


set value
NAME:
   set - set json value

USAGE:
   command set [command options] [arguments...]

OPTIONS:
   --file, -f [--file option --file option]	json files or folders
   --ext, -e ".json"				file ext, default is json
   --key, -k 					the key to be set
   --value, -v 					the key to be set
   --type, -t "string"				the value type, default is string, (string|int|float|object)
$ json_tool get -f "./" -e ".json" -k a -v 1 -t string

the test.json will be modify as follow:

{
	"a":"1",
	"b":"2"
}

```bash
$ json_tool get -f "./" -e ".json" -k a -v {\"c\":1} -t object

the test.json will be modify as follow:

{
	"a":{"c":1},
	"b":"2"
}


#### get value

```bash
NAME:
   get - get json value

USAGE:
   command get [command options] [arguments...]

OPTIONS:
   --file, -f [--file option --file option]	json files or folders
   --ext, -e ".json"				file ext, default is json
   --key, -k
$ json_tool get -f "./" -e ".json" -k a
./a.json:
{
   "a": {
     "b": 1
   }
 }

 ./b.json:
{
   "a": {
     "c": 1
   }
 }

 ...

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