jsoncat

所属分类:编译器/解释器
开发工具:C
文件大小:97KB
下载次数:0
上传日期:2020-10-05 13:59:48
上 传 者sh-1993
说明:  基于递归词法分析器的Json漂亮打印解析器
(Json pretty-print parser based on a recursive lexical analyser)

文件列表:
.travis.yml (82, 2020-10-05)
DEPENDENCIES (22, 2020-10-05)
LICENSE (18047, 2020-10-05)
Makefile (4722, 2020-10-05)
Makefile.conf (1065, 2020-10-05)
bin (0, 2020-10-05)
build (0, 2020-10-05)
build\Makefile (5587, 2020-10-05)
build\debian (0, 2020-10-05)
build\debian\changelog (184, 2020-10-05)
build\debian\compat (2, 2020-10-05)
build\debian\control (573, 2020-10-05)
build\debian\copyright (1079, 2020-10-05)
build\debian\manpages (15, 2020-10-05)
build\debian\rules (435, 2020-10-05)
build\debian\source (0, 2020-10-05)
build\debian\source\format (12, 2020-10-05)
build\rpmbuild (0, 2020-10-05)
build\rpmbuild\jsoncat.spec (1671, 2020-10-05)
build\scripts (0, 2020-10-05)
build\scripts\builder.sh (1823, 2020-10-05)
build\scripts\debian_build.sh (116, 2020-10-05)
build\scripts\rpm_build.sh (125, 2020-10-05)
build\scripts\utils.sh (355, 2020-10-05)
docs (0, 2020-10-05)
img (0, 2020-10-05)
img\jsoncat_logo.png (4511, 2020-10-05)
img\jsoncat_logo.xcf (14303, 2020-10-05)
img\jsoncat_logo_200x200.png (33284, 2020-10-05)
lib (0, 2020-10-05)
log (0, 2020-10-05)
src (0, 2020-10-05)
src\args.c (2788, 2020-10-05)
... ...

[![Build Status](https://travis-ci.org/pantuza/jsoncat.svg?branch=master)](https://travis-ci.org/pantuza/jsoncat) Jsoncat ======= ![jsoncat_logo](https://raw.githubusercontent.com/pantuza/jsoncat/master/img/jsoncat_logo.png "Jsoncat logo") ### Description Json pretty-print parser based on a recursive lexical analyser. The parser was based on the specification defined at [json.org](http://json.org). The input file is parsed to build a json object. If the object is correct, it will be pretty-printed to standard output. > Check out the [blog post](https://blog.pantuza.com/tutoriais/jsoncat-formatacao-json-no-terminal) about jsoncat [pt-BR] ### Usage Jsoncat parses a json that comes from a pipe to stdin. For example, parsing a request: ```bash $> curl -s https://pantuza.com/sample.json --insecure | jsoncat ``` ```javascript { 'what': "A json example file", 'test': true, 'values': [ 42, 10, 5.32], 'data': { 'name': 'Test Name', 'type': null } } ``` Or simple by passing a path to a json file as follows: ```bash $> jsoncat tests/samples/input_06.json ``` ```javascript { 'age': 42, 'name': 'marvin', 'what': 'robot' } ``` Or yet, again from stdin, by echoing a json: ```bash $> echo "{'test': true}" | jsoncat ``` ```javascript { 'test': true } ``` ### Installation ###### From Homebrew for Mac OS In a terminal install jsoncat from tap source: ```bash $> brew tap pantuza/homebrew-jsoncat $> brew install jsoncat ``` ###### From source Clone this repository, go to project directory and run: ```bash $> make $> make install ``` > **PS:** I'm creating the RPM and DEB packages. A soon as possible you would install jsoncat > from these sources. ### Options **-v | --version** > Prints jsoncat version **-h | --help** > Prints help message **--no-color** > Removes the color characters. This characters are useful only for the terminal that will pretty print the Json. > If you want to store the resulted Json to a file, use this option to persist a valid Json. **--tab-stop** > Sets the tab stop used by Jsoncat. We never insert tab character. Instead, we expand tab with spaces. > For that, the --tab-stop configures the number of spaces used for Json indentation. The default value > is 4. ### Contributing We are welcome to contributions. Just do a fork, modify some code and make a pull request. You may not forget to describe your modifications very well. It will help us on the code review. Try to write some tests, it would be nice. ### Coding style we are not stringent with it, but we like the [GNU C coding style](https://www.gnu.org/prep/standards/html_node/Writing-C.html). ### Testing Our test scripts are testing only the binary execution and checking for some error during the parsing and at the result. We use bash scripts to do this task. At the tests directory, there is a utils.sh file that defines the tests functions. Each other file in this directory uses the utils functions to run tests over strings, numbers, objects, arrays and constants. Also, there is a script to test the command line options. The samples directory has a lot of json sample files to use during development tests. For now, we are not using any tool for testing :/. If you have suggestions for it, please put it in an issue, we will certain check it out. ### Author ###### Written by [Gustavo Pantuza](https://pantuza.com) ### Reporting Bugs ###### Report Jsoncat bugs to gustavopantuza@gmail.com

近期下载者

相关文件


收藏者