12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879moduleFormatting=structletindentn=String.make(n*2)' 'letentern=String.maken'\n'letdouble_quotesstr="\""^str^"\""letsingle_quotesstr="'"^str^"'"endmoduleErrors=structletprint_error~colorizestr=letmoduleChalk=Chalk.Make(structletdisable=notcolorizeend)inFormatting.enter1^Chalk.red(Chalk.bold"Error")^Chalk.red":"^Formatting.indent1^str^Formatting.enter1letposition_to_stringstartend_=Printf.sprintf"[line: %d, char: %d-%d]"start.Lexing.pos_lnum(start.Lexing.pos_cnum-start.Lexing.pos_bol)(end_.Lexing.pos_cnum-end_.Lexing.pos_bol)letextract_exn(str:string)=letfirst=String.index_optstr'('inletlast=String.rindex_optstr')'inmatch(first,last)with|Somefirst_index,Somelast_index->letfirst=first_index+2inletlength=last_index-first_index-1-2inString.substrfirstlength|_,_->strletmake~colorize~input~(start:Lexing.position)~(end_:Lexing.position)=letmoduleChalk=Chalk.Make(structletdisable=notcolorizeend)inletpointer_range=String.make(end_.pos_cnum-start.pos_cnum)'^'inChalk.red(Chalk.bold"Parse error: ")^"Problem parsing at position "^position_to_stringstartend_^Formatting.enter2^"Input:"^Formatting.indent1^Chalk.green(Chalk.boldinput)^Formatting.enter1^Formatting.indent4^String.makestart.pos_cnum' '^Chalk.graypointer_rangeletnot_implementedf=Formatting.single_quotesf^" is not implemented"letmissingf=Formatting.single_quotesf^" looks like a function and maybe is not implemented or missing in the \
parser. Either way, could you open an issue \
'https://github.com/davesnx/query-json/issues/new'"endletusage?(colorize=true)()=letopenFormattinginletmoduleChalk=Chalk.Make(structletdisable=notcolorizeend)in[enter1;Chalk.yellow"Missing query as argument";enter1^"Usage:"^enter2^Chalk.bold"query-json"^Chalk.gray" [OPTIONS] "^"[QUERY] [JSON]"^enter2^Chalk.bold"OPTIONS";indent1^"-c, --no-color: Disable color in the output";indent1^"-k [VAL], --kind[=VAL]: input kind. "^double_quotes"file"^" | "^double_quotes"inline";indent1^"-v, --verbose: Activate verbossity";indent1^"-d, --debug: Print AST";indent1^"--version: Show version information."^enter2^Chalk.bold"EXAMPLES";indent1^"query-json '.dependencies' package.json";indent1^"query-json '.' <<< '[1, 2, 3]'"^enter2^Chalk.bold"MORE";indent1^" https://github.com/davesnx/query-json";enter1;]|>String.concat(enter1)