Skip to content

Commit

Permalink
Add debug and stderr builtins
Browse files Browse the repository at this point in the history
And refactor setup of jv dump flags.
  • Loading branch information
nicowilliams committed Jan 14, 2015
1 parent 9760245 commit aeb52e2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,12 @@ static jv f_debug(jq_state *jq, jv input) {
return input;
}

static jv f_stderr(jq_state *jq, jv input) {
jv_dumpf(jv_copy(input), stderr, 0);
fprintf(stderr, "\n");
return input;
}


#define LIBM_DD(name) \
{(cfunction_ptr)f_ ## name, "_" #name, 1},
Expand Down Expand Up @@ -959,6 +965,7 @@ static const struct cfunction function_list[] = {
{(cfunction_ptr)f_modulemeta, "modulemeta", 1},
{(cfunction_ptr)f_input, "_input", 1},
{(cfunction_ptr)f_debug, "debug", 1},
{(cfunction_ptr)f_stderr, "stderr", 1},
};
#undef LIBM_DD

Expand Down

0 comments on commit aeb52e2

Please sign in to comment.