remove -J option from release

This commit is contained in:
zawz 2021-05-28 16:35:24 +02:00
parent 8b6a576713
commit f9a3efce9a
5 changed files with 13 additions and 5 deletions

View file

@ -17,7 +17,7 @@ CC=g++
CXXFLAGS= -I$(IDIR) -Wall -std=c++20 CXXFLAGS= -I$(IDIR) -Wall -std=c++20
ifeq ($(DEBUG),true) ifeq ($(DEBUG),true)
# debugging flags # debugging flags
CXXFLAGS += -g CXXFLAGS += -g -D DEBUG_MODE
RODIR = $(ODIR)/debug RODIR = $(ODIR)/debug
else else
# release flags # release flags

View file

@ -171,11 +171,13 @@ int main(int argc, char* argv[])
list_fcts(sh, re_fct_exclude); list_fcts(sh, re_fct_exclude);
else if(options["list-cmd"]) else if(options["list-cmd"])
list_cmds(sh, regex_null); list_cmds(sh, regex_null);
// output #ifdef DEBUG_MODE
else if(options['J']) else if(options['J'])
{ {
std::cout << gen_json_struc(sh) << std::endl; std::cout << gen_json_struc(sh) << std::endl;
} }
#endif
// output
else else
{ {
// post-listing modifiers // post-listing modifiers

View file

@ -20,7 +20,10 @@ ztd::option_set options( {
ztd::option('c', "stdout", false, "Output result script to stdout"), ztd::option('c', "stdout", false, "Output result script to stdout"),
ztd::option('e', "exec", false, "Directly execute script"), ztd::option('e', "exec", false, "Directly execute script"),
ztd::option("no-shebang", false, "Don't output shebang"), ztd::option("no-shebang", false, "Don't output shebang"),
#ifdef DEBUG_MODE
ztd::option("\r [Debugging]"),
ztd::option('J', "json", false, "Output the json structure"), ztd::option('J', "json", false, "Output the json structure"),
#endif
ztd::option("\r [Processing]"), ztd::option("\r [Processing]"),
ztd::option('m', "minify", false, "Minify code without changing functionality"), ztd::option('m', "minify", false, "Minify code without changing functionality"),
ztd::option('M', "minify-full", false, "Enable all minifying features: -m --minify-quotes --minify-var --minify-fct --remove-unused"), ztd::option('M', "minify-full", false, "Enable all minifying features: -m --minify-quotes --minify-var --minify-fct --remove-unused"),

View file

@ -519,6 +519,7 @@ std::string boolstring(bool in)
return "false"; return "false";
} }
#ifdef DEBUG_MODE
std::string gen_json_struc(_obj* o) std::string gen_json_struc(_obj* o)
{ {
if(o==nullptr) if(o==nullptr)
@ -846,3 +847,4 @@ std::string gen_json_struc(_obj* o)
} }
return gen_json(vec); return gen_json(vec);
} }
#endif

View file

@ -7,7 +7,8 @@
const std::map<const std::string, const lxsh_fct> lxsh_extend_fcts = { const std::map<const std::string, const lxsh_fct> lxsh_extend_fcts = {
{ "_lxsh_random", { "[K]", "Generate a random number between 0 and 2^(K*8). Default 2", RANDOM_SH} }, { "_lxsh_random", { "[K]", "Generate a random number between 0 and 2^(K*8). Default 2", RANDOM_SH} },
{ "_lxsh_random_string", { "[N]", "Generate a random alphanumeric string of length N. Default 20", RANDOM_STRING_SH} }, { "_lxsh_random_string", { "[N]", "Generate a random alphanumeric string of length N. Default 20", RANDOM_STRING_SH} },
{ "_lxsh_random_tmpfile", { "[N]", "Get a random TMP filepath, with N random chars. Default 20", RANDOM_TMPFILE_SH, {"_lxsh_random_string"} } } { "_lxsh_random_tmpfile", { "[N]", "Get a random TMP filepath, with N random chars. Default 20", RANDOM_TMPFILE_SH, {"_lxsh_random_string"} }
}
}; };
const std::map<const std::string, const lxsh_fct> lxsh_array_fcts = { const std::map<const std::string, const lxsh_fct> lxsh_array_fcts = {