pretty

prettify json or yml files by printing an indented json
git clone https://noulin.net/git/pretty.git
Log | Files | Refs | LICENSE

pretty.c (371B)


      1 #! /usr/bin/env sheepy
      2 
      3 #include "libsheepyObject.h"
      4 
      5 int argc; char **argv;
      6 
      7 int main(int ARGC, char** ARGV) {
      8 
      9   argc = ARGC; argv = ARGV;
     10 
     11   if (argc < 2) {
     12       puts(BLD RED "File name missing" RST);
     13       XFAILURE
     14   }
     15 
     16   initLibsheepy(argv[0]);
     17 
     18   createSmallJson(j);
     19   readFileG(&j, argv[1]);
     20 
     21   char *s = stringifyG(&j, 2);
     22 
     23   puts(s);
     24   free(s);
     25 
     26   freeG(&j);
     27 }