diff --git a/src/main.cpp b/src/main.cpp index 21ca4a0..b1e5376 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -207,6 +207,10 @@ int main(int argc, char* argv[]) if(destfile.substr(0,5) != "/dev/") ztd::exec("chmod", "+x", destfile); } + else if(options['J']) + { + std::cout << gen_json_struc(sh) << std::endl; + } else // to console { std::cout << sh->generate(g_shebang, 0); diff --git a/src/options.cpp b/src/options.cpp index cc16ca8..1821f09 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -23,6 +23,7 @@ ztd::option_set gen_options() ztd::option('c', "stdout", false, "Output result script to stdout"), ztd::option('e', "exec", false, "Directly execute script"), ztd::option("no-shebang", false, "Don't output shebang"), + ztd::option('J', "json", false, "Output the json structure"), ztd::option("\r [Processing]"), ztd::option('C', "no-cd", false, "Don't cd when doing %include and %resolve"), ztd::option('m', "minimize", false, "Minimize code without changing functionality"),