Skip to content

Commit

Permalink
jq_sh: add sh/1 et al.
Browse files Browse the repository at this point in the history
  • Loading branch information
haochenx committed Nov 13, 2018
1 parent e864c18 commit 21da66b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/builtin.jq
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,11 @@ def JOIN($idx; stream; idx_expr; join_expr):
stream | [., $idx[idx_expr]] | join_expr;
def IN(s): reduce (first(select(. == s)) | true) as $v (false; if . or $v then true else false end);
def IN(src; s): reduce (src|IN(s)) as $v (false; if . or $v then true else false end);

# sh related
def sh: sh(.);
def sh_json: sh_json(.);
def sh_text: sh_text(.);
def qsh: qsh(.);
def qsh_json: qsh_json(.);
def qsh_text: qsh_text(.);

0 comments on commit 21da66b

Please sign in to comment.