dzove855 / bash-loadables-rust

Some bash loadables written in rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bash loadables builtins in rust

Json Encode/Decode -> bash-json-plugin

NOTE: It's all still experimental to learn Rust

Json Parser

NOTE: For the moment only decode is working.

compile:

cd json-builtin; cargo build

Move the target file where ever you want and then just enable it inside your script:

enable -f target/debug/libjson_builtin.so json 

test='{"testing": "hehe", "blob": "triiiiiiiii", "tik": {"muu": "haa", "tut": {"blea": "nek"}}, "mip": "fi", "nik": {"blik": "nek", "lorem": "ipsum", "candy": "handy"}, "michael": "jordan"}'

json -v exported -d test -D .

#Output of exported
declare -A exported=([nik.candy]="handy" [tik.muu]="haa" [nik.blik]="nek" [blob]="triiiiiiiii" [michael]="jordan" [mip]="fi" [nik.lorem]="ipsum" [testing]="hehe" [tik.tut.blea]="nek" )

Help Example:

    Options:
      -e        Encode.
      -d        Decode.
      -v        Variable to assign (Default: JSON)
      -D        Delimeter (Default: :)

About

Some bash loadables written in rust


Languages

Language:Rust 88.9%Language:Shell 11.1%