Core
There is no actual “core”, bash2json has simple system
bash2json
file contains all functions:
error <message>
: self-explanatory, error messagejson_trim <json>
: trim 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
- Each function depends on other functions to properly work
Function dependencies:
Section titled “Function dependencies:”error
: nonejson_trim
: nonejson_append
:json_trim
,json_query
,error
json_list
: nonejson_validate
: nonejson_query
:json_list
arr_to_json
:json_append
json_to_arr
:json_list
bash2json
:error
,json_validate
,json_append
,json_query
,json_to_arr
,json_trim
,arr_to_json