Core
There is no actual “core”, bash2json has simple system
bash2json file contains all functions:
error <message>: self-explanatory, error messagejson_trim <json> <validate?> <don't return?>: trim JSONjson_pretty <json> <don't return?>: prettify JSONjson_append <json> <key> <value?> <don't return?>: append JSONjson_list <json> <don't return?>: list JSON object/array keysjson_validate <json>: validate JSONjson_query <json> <raw?> <don't return?>: query JSONarr_to_json <array name> <don't return?>: bash array to JSONjson_to_arr <json> <output array name?> <parent key name?> <don't return?>: JSON to bash arraybash2json <all arguments>: main CLI which covers arguments parsing, functions execution and output wrapping
Reusing functions
Section titled “Reusing functions”You can reuse any function from bash2json, but:
- You can’t copyright any separate function as own code
- Some functions depend on other functions to properly work
Function dependencies:
Section titled “Function dependencies:”error: nonejson_trim: nonejson_pretty: nonejson_append:json_trim,json_query,errorjson_list: nonejson_validate:errorjson_query:json_list,errorarr_to_json:json_appendjson_to_arr:json_listbash2json:error,json_validate,json_append,json_query,json_to_arr,json_trim,json_pretty,arr_to_json