All Projects → pantuza → jsoncat

pantuza / jsoncat

Licence: GPL-2.0 License
Json pretty-print parser based on a recursive lexical analyser

Programming Languages

c
50402 projects - #5 most used programming language
shell
77523 projects
Makefile
30231 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to jsoncat

CastXMLSuperbuild
Build CastXML and its dependencies (LLVM/Clang)
Stars: ✭ 32 (+23.08%)
Mutual labels:  clang
stack-guard
A toy implementation of 'Stack Guard' on top of the LLVM compiler toolchain
Stars: ✭ 21 (-19.23%)
Mutual labels:  clang
wasm-toolchain
WebAssembly toolchain
Stars: ✭ 34 (+30.77%)
Mutual labels:  clang
ci playground
Playground for Cloud CI development for C++
Stars: ✭ 23 (-11.54%)
Mutual labels:  clang
core-review
Scripts, tools & info for doing Bitcoin Core development and code review
Stars: ✭ 78 (+200%)
Mutual labels:  clang
jsonlint
JSON/CJSON/JSON5 parser, syntax & schema validator and pretty-printer with a command-line client, written in pure JavaScript.
Stars: ✭ 21 (-19.23%)
Mutual labels:  pretty-print
rebuild
Zero-dependency, reproducible build environments
Stars: ✭ 48 (+84.62%)
Mutual labels:  clang
hmg
💝 My personal Gentoo/Linux configuration backup files
Stars: ✭ 16 (-38.46%)
Mutual labels:  clang
lldbg
A lightweight native GUI for LLDB.
Stars: ✭ 83 (+219.23%)
Mutual labels:  clang
efi-clang
Build UEFI applications with the Clang compiler and LLD linker.
Stars: ✭ 40 (+53.85%)
Mutual labels:  clang
cdetect
🔬 Detect which compiler and compiler version a Linux executable (in the ELF format) was compiled with
Stars: ✭ 23 (-11.54%)
Mutual labels:  clang
opencilk-project
Monorepo for the OpenCilk compiler, forked from llvm/llvm-project. See the OpenCilk/infrastructure repository for build and installation instructions.
Stars: ✭ 42 (+61.54%)
Mutual labels:  clang
dist-clang
Distributed [cross-]compilation for Clang
Stars: ✭ 31 (+19.23%)
Mutual labels:  clang
proton-clang-build
A set of scripts to build optimized LLVM and binutils toolchains. See https://github.com/kdrag0n/proton-clang for prebuilts.
Stars: ✭ 30 (+15.38%)
Mutual labels:  clang
prism-pretty
A Chrome Extension to format/highlight/preview HTML/JS/CSS/Markdown code with Prism.js
Stars: ✭ 91 (+250%)
Mutual labels:  pretty-print
vscode-clang-complete
Visual Studio Code C/C++ completion using Clang
Stars: ✭ 15 (-42.31%)
Mutual labels:  clang
lsif-clang
Language Server Indexing Format (LSIF) generator for C, C++ and Objective C
Stars: ✭ 28 (+7.69%)
Mutual labels:  clang
flutter from scratch
A minimal Flutter Embedder from Scratch.
Stars: ✭ 122 (+369.23%)
Mutual labels:  clang
setup-clang
GitHub action to set up Clang & LLVM
Stars: ✭ 28 (+7.69%)
Mutual labels:  clang
cpp-compiler-options
Compilation options for different versions of Clang, GCC and MSVC. Provided a generator and different file formats (cmake, xmake, meson, premake5, bjam/b2, ...)
Stars: ✭ 19 (-26.92%)
Mutual labels:  clang

Build Status

Jsoncat

jsoncat_logo

Description

Json pretty-print parser based on a recursive lexical analyser. The parser was based on the specification defined at 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 about jsoncat [pt-BR]

Usage

Jsoncat parses a json that comes from a pipe to stdin. For example, parsing a request:

$> curl -s https://pantuza.com/sample.json --insecure | jsoncat
{
        '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:

$> jsoncat tests/samples/input_06.json
{
        'age': 42,
        'name': 'marvin',
        'what': 'robot'
}

Or yet, again from stdin, by echoing a json:

$> echo "{'test': true}" | jsoncat
{
        'test': true
}

Installation

From Homebrew for Mac OS

In a terminal install jsoncat from tap source:

$> brew tap pantuza/homebrew-jsoncat
$> brew install jsoncat
From source

Clone this repository, go to project directory and run:

$> 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.

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

Reporting Bugs

Report Jsoncat bugs to [email protected]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].