Hello community,

here is the log from the commit of package jo for openSUSE:Leap:15.2 checked in 
at 2020-01-17 12:01:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/jo (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.jo.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "jo"

Fri Jan 17 12:01:38 2020 rev:3 rq:763597 version:1.3

Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/jo/jo.changes  2020-01-15 15:13:30.486177613 
+0100
+++ /work/SRC/openSUSE:Leap:15.2/.jo.new.26092/jo.changes       2020-01-17 
12:01:40.428510221 +0100
@@ -1,0 +2,11 @@
+Wed Nov  6 19:10:31 UTC 2019 - Martin Hauke <[email protected]>
+
+- Update to version 1.3
+  * FIX: Escaped @ ("\@") is treated as "@"
+  * NEW: Support reading JSON array elements
+  * UPD: Add home and removable-media interfaces to snap
+  * FIX: fix unlikely crash after malloc fail when base64 encoding.
+  * NEW: Support reading nested data from pipes
+- Add new subpackage for bash-completion
+
+-------------------------------------------------------------------

Old:
----
  jo-1.2.tar.gz

New:
----
  jo-1.3.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ jo.spec ++++++
--- /var/tmp/diff_new_pack.O8WuwN/_old  2020-01-17 12:01:40.848510405 +0100
+++ /var/tmp/diff_new_pack.O8WuwN/_new  2020-01-17 12:01:40.852510407 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           jo
-Version:        1.2
+Version:        1.3
 Release:        0
 Summary:        JSON output from a shell
 License:        GPL-2.0-or-later AND MIT
@@ -28,15 +28,29 @@
 BuildRequires:  autoconf
 BuildRequires:  automake
 BuildRequires:  pandoc
+BuildRequires:  pkgconfig
 
 %description
 This is jo, a small utility to create JSON objects
 
+%package bash-completion
+Summary:        Bash Completion for %{name}
+Group:          Productivity/Text/Utilities
+Requires:       %{name} = %{version}
+Requires:       bash-completion
+Supplements:    packageand(jo:bash)
+BuildArch:      noarch
+
+%description bash-completion
+Bash completion script for %{name}.
+
+
 %prep
 %setup -q
 
 %build
 autoreconf -fiv
+export bashcompdir=%{_datadir}/bash-completion/completions/
 %configure
 make %{?_smp_mflags}
 
@@ -52,4 +66,7 @@
 %{_bindir}/jo
 %{_mandir}/man1/jo.1%{?ext_man}
 
+%files bash-completion
+%{_datadir}/bash-completion/completions/%{name}.bash
+
 %changelog

++++++ jo-1.2.tar.gz -> jo-1.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/.travis.yml new/jo-1.3/.travis.yml
--- old/jo-1.2/.travis.yml      2018-12-10 19:10:23.000000000 +0100
+++ new/jo-1.3/.travis.yml      2019-11-04 09:40:39.000000000 +0100
@@ -15,6 +15,4 @@
  - autoreconf -i
  - ./configure
 script:
- - make
  - make check
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/ChangeLog new/jo-1.3/ChangeLog
--- old/jo-1.2/ChangeLog        2018-12-10 19:10:23.000000000 +0100
+++ new/jo-1.3/ChangeLog        2019-11-04 09:40:39.000000000 +0100
@@ -1,4 +1,26 @@
 
+2019-11-04 1.3
+- FIX: Escaped @ ("\@") is treated as "@" (#42, #103)
+- NEW: Support reading JSON array elements (#91)
+- UPD: Add home and removable-media interfaces to snap (#94)
+- FIX: fix unlikely crash after malloc fail when base64 encoding.
+- NEW: Support reading nested data from pipes (#82)
+
+2018-12-10 1.2
+- NEW: Dockerfile (#76)
+- UPD: add examples of empty arrays/objects to manual (#74)
+- NEW: support -e to ignore empty stdin; contributed by Robi Karp
+- NEW: object-path support (#57)
+
+2017-05-18 1.1
+- NEW: type coercion (#55)
+- FIX: quotes in quotes and double quotes at begin of string (#47)
+- FIX: catch null value in assignmen (#46)
+- NEW: support for key:=file.json for reading object values from a file (#43)
+- NEW: PPA contributed by Ross Duggan in #32
+- FIX: "null" is now handled like we handle "true" and "false"; disable with -B
+- NEW: more tests in the test suite
+
 2016-03-11 1.0
 - NEW: read JSON element values from files (#22)
 - FIX: usage diagnostic
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/Makefile.am new/jo-1.3/Makefile.am
--- old/jo-1.2/Makefile.am      2018-12-10 19:10:23.000000000 +0100
+++ new/jo-1.3/Makefile.am      2019-11-04 09:40:39.000000000 +0100
@@ -7,6 +7,9 @@
 dist_man_MANS  = jo.1
 jo_LDADD       = -lm
 
+bashcompdir = @bashcompdir@
+dist_bashcomp_DATA = jo.bash
+
 if USE_PANDOC
 # Add targets to rebuild pages
 jo.1: jo.pandoc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/README.md new/jo-1.3/README.md
--- old/jo-1.2/README.md        2018-12-10 19:10:23.000000000 +0100
+++ new/jo-1.3/README.md        2019-11-04 09:40:39.000000000 +0100
@@ -34,8 +34,6 @@
 make install
 ```
 
-[![asciicast](https://asciinema.org/a/4y7471mjfhvv2x4mdqmwfhu31.png)](https://asciinema.org/a/4y7471mjfhvv2x4mdqmwfhu31)
-
 
 ## Build from Github
 
@@ -68,6 +66,10 @@
 apt-get install jo
 ```
 
+## Snap
+
+Thanks to [Roger 
Light](https://twitter.com/ralight/status/1166023769623867398), _jo_ is 
available as a [snap package](https://snapcraft.io/jo). Use `snap install jo` 
from a Linux distro that supports snaps.
+
 ## Others
 
 * 
[voidlinux](https://github.com/voidlinux/void-packages/tree/master/srcpkgs/jo)
@@ -77,6 +79,12 @@
 * [pkgsrc](http://pkgsrc.se/textproc/jo)
 * [repology.org](https://repology.org/metapackage/jo/versions)
 
+## See also
+
+* [gjo](https://github.com/skanehira/gjo)
+* [rjo](https://github.com/dskkato/rjo)
+* [jjo](https://github.com/memoryhole/jjo)
+
 ## Credits
 
 * `json.[ch]` by 2011 Joseph A. Adams ([email protected]).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/base64.c new/jo-1.3/base64.c
--- old/jo-1.2/base64.c 2018-12-10 19:10:23.000000000 +0100
+++ new/jo-1.3/base64.c 2019-11-04 09:40:39.000000000 +0100
@@ -26,6 +26,10 @@
        const unsigned char* q = (const unsigned char*) buf;
        size_t i = 0;
 
+       if (str == NULL) {
+               return NULL;
+       }
+
        while (i < size) {
                int c = q[i++];
                c *= 256;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/configure.ac new/jo-1.3/configure.ac
--- old/jo-1.2/configure.ac     2018-12-10 19:10:23.000000000 +0100
+++ new/jo-1.3/configure.ac     2019-11-04 09:40:39.000000000 +0100
@@ -1,5 +1,5 @@
 AC_PREREQ([2.63])
-AC_INIT([jo], [1.1], [[email protected]])
+AC_INIT([jo], [1.3], [[email protected]])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_SRCDIR([jo.c])
 
@@ -28,6 +28,10 @@
 fi
 AM_CONDITIONAL([USE_PANDOC], [test -n "$PANDOC"])
 
+PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir], ,
+     bashcompdir="${sysconfdir}/bash_completion.d")
+AC_SUBST(bashcompdir)
+
 AC_CONFIG_FILES([Makefile tests/jo.07.sh])
 AC_OUTPUT
 
@@ -36,6 +40,7 @@
   Prefix.........: $prefix
   C compiler.....: $CC $CFLAGS $CPPFLAGS
   Pandoc.........: ${PANDOC:-NONE}
+  Bash completion: $bashcompdir/jo.bash
 
   Now type 'make @<:@<target>@:>@'
     where the optional <target> is:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/jo.1 new/jo-1.3/jo.1
--- old/jo-1.2/jo.1     2018-12-10 19:10:23.000000000 +0100
+++ new/jo-1.3/jo.1     2019-11-04 09:40:39.000000000 +0100
@@ -39,6 +39,8 @@
 When the \f[C]:=\f[] operator is used in a \f[I]word\f[], the name to
 the right of \f[C]:=\f[] is a file containing JSON which is parsed and
 assigned to the key left of the operator.
+The file may be specified as \f[C]\-\f[] to read from \f[I]jo\f[]\[aq]s
+standard input.
 .SH TYPE COERCION
 .PP
 \f[I]jo\f[]\[aq]s type guesses can be overridden on a per\-word basis by
@@ -319,7 +321,8 @@
 .PP
 Read element values from files: a value which starts with \f[C]\@\f[] is
 read in plain whereas if it begins with a \f[C]%\f[] it will be
-base64\-encoded:
+base64\-encoded and if it starts with \f[C]:\f[] the contents are
+interpreted as JSON:
 .IP
 .nf
 \f[C]
@@ -328,6 +331,9 @@
 
 $\ jo\ filename=AUTHORS\ content=%AUTHORS
 {"filename":"AUTHORS","content":"SmFuLVBpZXQgTWVucyA8anBtZW5zQGdtYWlsLmNvbT4K"}
+
+$\ jo\ nested=:nested.json
+{"nested":{"field1":123,"field2":"abc"}}
 \f[]
 .fi
 .PP
@@ -339,6 +345,10 @@
 $\ ls\ |\ jo\ \-a\ >\ child.json
 $\ jo\ files:=child.json
 {"files":["AUTHORS","COPYING","ChangeLog"\ ....
+
+$\ ls\ *.c\ |\ jo\ \-a\ >\ source.json;\ ls\ *.h\ |\ jo\ \-a\ >\ headers.json
+$\ jo\ \-a\ :source.json\ :headers.json
+[["base64.c","jo.c","json.c"],["base64.h","json.h"]]
 \f[]
 .fi
 .SH OPTIONS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/jo.bash new/jo-1.3/jo.bash
--- old/jo-1.2/jo.bash  1970-01-01 01:00:00.000000000 +0100
+++ new/jo-1.3/jo.bash  2019-11-04 09:40:39.000000000 +0100
@@ -0,0 +1,38 @@
+# bash completion for jo(1)
+
+_jo() {
+
+    # Don't split words on =, for =@ and =% handling
+    COMP_WORDBREAKS=${COMP_WORDBREAKS//=}
+
+    # No completion if an exit causing flag is around
+    local i
+    for i in ${!COMP_WORDS[@]}; do
+        [[ $i -ne $COMP_CWORD && ${COMP_WORDS[i]} == -*[hvV]* ]] && return 0
+    done
+
+    # Complete available options following a dash
+    if [[ $2 == -* ]]; then
+        COMPREPLY=( $(compgen -W '-a -B -h -p -v -V' -- "$2") )
+        return 0
+    fi
+
+    # Complete filenames on =@ and =%
+    if [[ $2 == *=[@%]* ]]; then
+        local file prefix
+        file="${2#*=[@%]}"
+        prefix="${2:0:${#2}-${#file}}"
+        compopt -o filenames
+        COMPREPLY=( $(compgen -f -- "$file") )
+        if [[ ${#COMPREPLY[@]} -eq 1 ]]; then
+            if [[ -d "${COMPREPLY[0]}" ]]; then
+                COMPREPLY[0]+=/
+                compopt -o nospace
+            fi
+            COMPREPLY[0]="$prefix${COMPREPLY[0]}"
+        fi
+        return 0
+    fi
+
+} &&
+complete -F _jo jo
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/jo.c new/jo-1.3/jo.c
--- old/jo-1.2/jo.c     2018-12-10 19:10:23.000000000 +0100
+++ new/jo-1.3/jo.c     2019-11-04 09:40:39.000000000 +0100
@@ -13,7 +13,7 @@
 #include "base64.h"
 
 /*
- * Copyright (C) 2016 Jan-Piet Mens <[email protected]>
+ * Copyright (C) 2016-2019 Jan-Piet Mens <[email protected]>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -22,7 +22,7 @@
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
@@ -38,6 +38,9 @@
 #define FLAG_NOSTDIN   0x10
 #define FLAG_MASK      (FLAG_ARRAY | FLAG_PRETTY | FLAG_NOBOOL | FLAG_BOOLEAN 
| FLAG_NOSTDIN)
 
+/* Size of buffer blocks for pipe slurping */
+#define SLURP_BLOCK_SIZE 4096
+
 static JsonNode *pile;         /* pile of nested objects/arrays */
 
 #ifdef _WIN32
@@ -95,29 +98,51 @@
        }
 }
 
-char *slurp_file(FILE *fp, size_t *out_len, bool fold_newlines)
+const char *maybe_stdin(const char* filename)
+{
+       return strcmp(filename, "-") ? filename : "/dev/fd/0";
+}
+               
+
+char *slurp_file(const char* filename, size_t *out_len, bool fold_newlines)
 {
-       char *buf, *bp;
+       char *buf;
+       int i = 0;
        int ch;
-       off_t file_len;
+       off_t buffer_len;
+       FILE *fp;
 
+       if ((fp = fopen(maybe_stdin(filename), "r")) == NULL) {
+               perror(filename);
+               errx(1, "Cannot open %s for reading", filename);
+       }
        if (fseeko(fp, 0, SEEK_END) != 0) {
-               fclose(fp);
-               return (NULL);
+               /* If we cannot seek, we're operating off a pipe and
+                  need to dynamically grow the buffer that we're
+                  reading into */
+               buffer_len = SLURP_BLOCK_SIZE;
+       } else {
+               buffer_len = ftello(fp) + 1;
+               fseeko(fp, 0, SEEK_SET);
        }
-       file_len = ftello(fp);
-       fseeko(fp, 0, SEEK_SET);
 
-       if ((bp = buf = malloc(file_len + 1)) == NULL) {
-               fclose(fp);
-               return (NULL);
+       if ((buf = malloc(buffer_len)) == NULL) {
+               errx(1, "File %s is too large to be read into memory", 
filename);
        }
        while ((ch = fgetc(fp)) != EOF) {
-               if (ch != '\n' || !fold_newlines)
-                       *bp++ = ch;
+               if (i == (buffer_len - 1)) {
+                       buffer_len += SLURP_BLOCK_SIZE;
+                       if ((buf = realloc(buf, buffer_len)) == NULL) {
+                               errx(1, "File %s is too large to be read into 
memory", filename);
+                       }
+               }
+               if (ch != '\n' || !fold_newlines) {
+                       buf[i++] = ch;
+               }
        }
-       *bp = 0;
-       *out_len = bp - buf;
+        fclose(fp);
+       buf[i] = 0;
+       *out_len = i;
        return (buf);
 }
 
@@ -230,44 +255,53 @@
                }
        }
 
-       if (*str == '@' || *str == '%') {
-               char *filename = str + 1, *content;
-               bool binmode = (*str == '%');
-               size_t len = 0;
-               JsonNode *j;
-               FILE *fp;
-
-               if ((fp = fopen(filename, binmode ? "rb" : "r")) == NULL) {
-                       errx(1, "Cannot open %s for reading", filename);
-               }
-
-               if ((content = slurp_file(fp, &len, false)) == NULL) {
-                       errx(1, "Error reading file %s", filename);
-               }
-
-               fclose(fp);
-
-               if (binmode) {
-                       char *encoded;
-
-                       if ((encoded = base64_encode(content, len)) == NULL) {
-                               errx(1, "Cannot base64-encode file %s", 
filename);
+       if (*str == '\\') {
+               ++str;
+       } else {
+               if (*str == '@' || *str == '%' || *str == ':') {
+                       char *filename = str + 1, *content;
+                       bool binmode = (*str == '%');
+                       bool jsonmode = (*str == ':');
+                       size_t len = 0;
+                       JsonNode *j = NULL;
+       
+                       if ((content = slurp_file(filename, &len, false)) == 
NULL) {
+                               errx(1, "Error reading file %s", filename);
                        }
-
-                       j = json_mkstring(encoded);
-                       free(encoded);
-               } else {
-                       char *bp = content + strlen(content) - 1;
-
-                       if (*bp == '\n') *bp-- = 0;
-                       if (*bp == '\r') *bp = 0;
-                       j = json_mkstring(content);
+       
+                       if (binmode) {
+                               char *encoded;
+       
+                               if ((encoded = base64_encode(content, len)) == 
NULL) {
+                                       errx(1, "Cannot base64-encode file %s", 
filename);
+                               }
+       
+                               j = json_mkstring(encoded);
+                               free(encoded);
+                       } else if (jsonmode) {
+                               j = json_decode(content);
+                               if (j == NULL) {
+                                       errx(1, "Cannot decode JSON in file 
%s", filename);
+                               }
+                       }
+       
+                       // If it got this far without valid JSON, just consider 
it a string
+                       if (j == NULL) {
+                               char *bp = content + strlen(content) - 1;
+       
+                               if (*bp == '\n') *bp-- = 0;
+                               if (*bp == '\r') *bp = 0;
+                               j = json_mkstring(content);
+                       }
+                       free(content);
+                       return (j);
                }
-               free(content);
-               return (j);
        }
 
        if (*str == '{' || *str == '[') {
+               if (type == JSON_STRING) {
+                       return json_mkstring(str);
+               }
                JsonNode *obj = json_decode(str);
 
                if (obj == NULL) {
@@ -405,21 +439,16 @@
        char *r = strchr(kv, ':');
 
        if ((r && *(r+1) == '=') && !q) {
-               FILE *fp;
                char *filename = p + 1;
                char *content;
                size_t len;
 
-               if ((fp = fopen(filename, "r")) == NULL) {
-                       errx(1, "Cannot open %s for reading", filename);
-               }
-               if ((content = slurp_file(fp, &len, false)) == NULL) {
+               if ((content = slurp_file(filename, &len, false)) == NULL) {
                        errx(1, "Error reading file %s", filename);
                }
 
                JsonNode *o = json_decode(content);
                free(content);
-               fclose(fp);
 
                if (o == NULL) {
                        errx(1, "Cannot decode JSON in file %s", filename);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/jo.md new/jo-1.3/jo.md
--- old/jo-1.2/jo.md    2018-12-10 19:10:23.000000000 +0100
+++ new/jo-1.3/jo.md    2019-11-04 09:40:39.000000000 +0100
@@ -1,6 +1,6 @@
 ---
 title: 'JO(1) User Manuals'
-...
+---
 
 NAME
 ====
@@ -37,7 +37,8 @@
 
 When the `:=` operator is used in a *word*, the name to the right of
 `:=` is a file containing JSON which is parsed and assigned to the key
-left of the operator.
+left of the operator. The file may be specified as `-` to read from
+*jo*'s standard input.
 
 TYPE COERCION
 =============
@@ -197,7 +198,8 @@
     ["123",14,true,456]
 
 Read element values from files: a value which starts with `@` is read in
-plain whereas if it begins with a `%` it will be base64-encoded:
+plain whereas if it begins with a `%` it will be base64-encoded and if
+it starts with `:` the contents are interpreted as JSON:
 
     $ jo program=jo authors=@AUTHORS
     {"program":"jo","authors":"Jan-Piet Mens <[email protected]>"}
@@ -205,6 +207,9 @@
     $ jo filename=AUTHORS content=%AUTHORS
     
{"filename":"AUTHORS","content":"SmFuLVBpZXQgTWVucyA8anBtZW5zQGdtYWlsLmNvbT4K"}
 
+    $ jo nested=:nested.json
+    {"nested":{"field1":123,"field2":"abc"}}
+
 Read element values from a file in order to overcome ARG\_MAX limits
 during object assignment:
 
@@ -212,6 +217,10 @@
     $ jo files:=child.json
     {"files":["AUTHORS","COPYING","ChangeLog" ....
 
+    $ ls *.c | jo -a > source.json; ls *.h | jo -a > headers.json
+    $ jo -a :source.json :headers.json
+    [["base64.c","jo.c","json.c"],["base64.h","json.h"]]
+
 OPTIONS
 =======
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/jo.pandoc new/jo-1.3/jo.pandoc
--- old/jo-1.2/jo.pandoc        2018-12-10 19:10:23.000000000 +0100
+++ new/jo-1.3/jo.pandoc        2019-11-04 09:40:39.000000000 +0100
@@ -24,7 +24,8 @@
 
 *jo* creates an array instead of an object when `-a` is specified.
 
-When the `:=` operator is used in a _word_, the name to the right of `:=` is a 
file containing JSON which is parsed and assigned to the key left of the 
operator.
+When the `:=` operator is used in a _word_, the name to the right of `:=` is a 
file containing JSON which is parsed and assigned to the key left of the 
operator. The file may be specified as `-` to read from _jo_'s standard input.
+
 
 # TYPE COERCION
 
@@ -173,7 +174,7 @@
        $ jo -a -- -s 123 -n "This is a test" -b C_Rocks 456
        ["123",14,true,456]
 
-Read element values from files: a value which starts with `@` is read in plain 
whereas if it begins with a `%` it will be base64-encoded:
+Read element values from files: a value which starts with `@` is read in plain 
whereas if it begins with a `%` it will be base64-encoded and if it starts with 
`:` the contents are interpreted as JSON:
 
        $ jo program=jo authors=@AUTHORS
        {"program":"jo","authors":"Jan-Piet Mens <[email protected]>"}
@@ -181,12 +182,19 @@
        $ jo filename=AUTHORS content=%AUTHORS
        
{"filename":"AUTHORS","content":"SmFuLVBpZXQgTWVucyA8anBtZW5zQGdtYWlsLmNvbT4K"}
 
+       $ jo nested=:nested.json
+       {"nested":{"field1":123,"field2":"abc"}}
+
 Read element values from a file in order to overcome ARG_MAX limits during 
object assignment:
 
        $ ls | jo -a > child.json
        $ jo files:=child.json
        {"files":["AUTHORS","COPYING","ChangeLog" ....
 
+       $ ls *.c | jo -a > source.json; ls *.h | jo -a > headers.json
+       $ jo -a :source.json :headers.json
+       [["base64.c","jo.c","json.c"],["base64.h","json.h"]]
+
 # OPTIONS
 
 *jo* understands the following global options. 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/snapcraft.yaml new/jo-1.3/snapcraft.yaml
--- old/jo-1.2/snapcraft.yaml   1970-01-01 01:00:00.000000000 +0100
+++ new/jo-1.3/snapcraft.yaml   2019-11-04 09:40:39.000000000 +0100
@@ -0,0 +1,19 @@
+name: jo
+version: "1.3"
+summary: jo
+description: |
+  This is jo, a small utility to create JSON objects or arrays.
+
+confinement: strict
+grade: stable
+
+apps:
+  jo:
+    command: jo
+    plugs: [home, removable-media]
+
+parts:
+  jo:
+    plugin: autotools
+    source-type: git
+    source: https://github.com/jpmens/jo
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/tests/jo.19.exp new/jo-1.3/tests/jo.19.exp
--- old/jo-1.2/tests/jo.19.exp  1970-01-01 01:00:00.000000000 +0100
+++ new/jo-1.3/tests/jo.19.exp  2019-11-04 09:40:39.000000000 +0100
@@ -0,0 +1 @@
+{"foo":["hello world"]}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/tests/jo.19.sh new/jo-1.3/tests/jo.19.sh
--- old/jo-1.2/tests/jo.19.sh   1970-01-01 01:00:00.000000000 +0100
+++ new/jo-1.3/tests/jo.19.sh   2019-11-04 09:40:39.000000000 +0100
@@ -0,0 +1,3 @@
+# read from pipe
+
+echo '["hello world"]' | ${JO:-jo} foo:=-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/tests/jo.20.exp new/jo-1.3/tests/jo.20.exp
--- old/jo-1.2/tests/jo.20.exp  1970-01-01 01:00:00.000000000 +0100
+++ new/jo-1.3/tests/jo.20.exp  2019-11-04 09:40:39.000000000 +0100
@@ -0,0 +1 @@
+[{"a":1,"b":"val"},{"a":478,"b":"other"}]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/tests/jo.20.sh new/jo-1.3/tests/jo.20.sh
--- old/jo-1.2/tests/jo.20.sh   1970-01-01 01:00:00.000000000 +0100
+++ new/jo-1.3/tests/jo.20.sh   2019-11-04 09:40:39.000000000 +0100
@@ -0,0 +1,9 @@
+# read json array elements
+
+echo '{"a":1,"b":"val"}' > $$.1
+echo '{"a":478,"b":"other"}' > $$.2
+
+${JO:-jo} -a :$$.1 :$$.2
+
+rm -f $$.1
+rm -f $$.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/tests/jo.21.exp new/jo-1.3/tests/jo.21.exp
--- old/jo-1.2/tests/jo.21.exp  1970-01-01 01:00:00.000000000 +0100
+++ new/jo-1.3/tests/jo.21.exp  2019-11-04 09:40:39.000000000 +0100
@@ -0,0 +1 @@
+{"nested":{"a":1,"b":"val"}}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/tests/jo.21.sh new/jo-1.3/tests/jo.21.sh
--- old/jo-1.2/tests/jo.21.sh   1970-01-01 01:00:00.000000000 +0100
+++ new/jo-1.3/tests/jo.21.sh   2019-11-04 09:40:39.000000000 +0100
@@ -0,0 +1,7 @@
+# read nested json elements
+
+echo '{"a":1,"b":"val"}' > $$.1
+
+${JO:-jo} nested=:$$.1
+
+rm -f $$.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/tests/jo.22.exp new/jo-1.3/tests/jo.22.exp
--- old/jo-1.2/tests/jo.22.exp  1970-01-01 01:00:00.000000000 +0100
+++ new/jo-1.3/tests/jo.22.exp  2019-11-04 09:40:39.000000000 +0100
@@ -0,0 +1 @@
+{"key":"@timestamp"}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jo-1.2/tests/jo.22.sh new/jo-1.3/tests/jo.22.sh
--- old/jo-1.2/tests/jo.22.sh   1970-01-01 01:00:00.000000000 +0100
+++ new/jo-1.3/tests/jo.22.sh   2019-11-04 09:40:39.000000000 +0100
@@ -0,0 +1,4 @@
+# avoid reading from file if escaped \@
+
+${JO:-jo} key="\@timestamp"
+


Reply via email to