diff --git a/c/cli/mlrcli.c b/c/cli/mlrcli.c index ab6f885cb..164071676 100644 --- a/c/cli/mlrcli.c +++ b/c/cli/mlrcli.c @@ -202,6 +202,8 @@ static char* rebackslash(char* sep) { #define DEFAULT_JSON_FLATTEN_SEPARATOR ":" +#define DEFAULT_OOSVAR_FLATTEN_SEPARATOR ":" + // ---------------------------------------------------------------- // The main_usage() function is split out into subroutines in support of the // manpage autogenerator. @@ -594,6 +596,8 @@ cli_opts_t* parse_command_line(int argc, char** argv) { popts->quote_json_values_always = FALSE; popts->json_flatten_separator = DEFAULT_JSON_FLATTEN_SEPARATOR; + popts->oosvar_flatten_separator = DEFAULT_OOSVAR_FLATTEN_SEPARATOR; + popts->ofmt = DEFAULT_OFMT; popts->oquoting = DEFAULT_OQUOTING; @@ -769,6 +773,11 @@ cli_opts_t* parse_command_line(int argc, char** argv) { popts->json_flatten_separator = cli_sep_from_arg(argv[argi+1], argv[0]); argi++; + } else if (streq(argv[argi], "--vflatsep")) { + check_arg_count(argv, argi, argc, 2); + popts->oosvar_flatten_separator = cli_sep_from_arg(argv[argi+1], argv[0]); + argi++; + } else if (streq(argv[argi], "--csv")) { popts->ifile_fmt = popts->ofile_fmt = "csv"; } else if (streq(argv[argi], "--icsv")) { popts->ifile_fmt = "csv"; } else if (streq(argv[argi], "--ocsv")) { popts->ofile_fmt = "csv"; diff --git a/c/cli/mlrcli.h b/c/cli/mlrcli.h index afea95c3d..2e3b16ad8 100644 --- a/c/cli/mlrcli.h +++ b/c/cli/mlrcli.h @@ -36,6 +36,8 @@ typedef struct _cli_opts_t { int quote_json_values_always; char* json_flatten_separator; + char* oosvar_flatten_separator; + char* ofmt; quoting_t oquoting; diff --git a/c/todo.txt b/c/todo.txt index 163566b89..9485ee591 100644 --- a/c/todo.txt +++ b/c/todo.txt @@ -59,6 +59,8 @@ TOP-OF-LIST SUMMARY ---------------------------------------------------------------- IMPLEMENT: +? people may ask for ingest version of emit ... + ? try to merge emitf and emit * cli-parameterize the joinchar (:)