Skip to content

Commit

Permalink
version 0.9
Browse files Browse the repository at this point in the history
	revert $JO_PRETTY
  • Loading branch information
jpmens committed Mar 10, 2016
1 parent 85ba296 commit 2a9aa61
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 63 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

2016-03-10 0.9
- UPD: revert support for $JO_PRETTY et. al; it was a bad idea

2016-03-10 0.8
- UPD: new test suite
- NEW: support for nested elements (#19)
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AC_PREREQ([2.69])
AC_INIT([jo], [0.8], [[email protected]])
AC_INIT([jo], [0.9], [[email protected]])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([jo.c])

Expand Down
17 changes: 0 additions & 17 deletions jo.1
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ Disable with this option.
.B \-p
Pretty\-print the JSON string on output instead of the terse one\-line
output it prints by default.
(See \f[C]$JO_PRETTY\f[] and \f[C]$JO_SPACER\f[] below.)
.RS
.RE
.TP
Expand All @@ -153,22 +152,6 @@ Show version and exit.
Show version as a JSON object and exit.
.RS
.RE
.SH ENVIRONMENT
.PP
\f[I]jo\f[] attempts to use the following variables from its
environment:
.TP
.B JO_PRETTY
If this variable is set to any value, \f[I]jo\f[] will pretty\-print on
output without having to specify \f[C]\-p\f[].
.RS
.RE
.TP
.B JO_SPACER
When pretty\-printing, \f[I]jo\f[] uses three spaces by default.
Set this variable to any number of spaces or tabs to use instead.
.RS
.RE
.SH BUGS
.PP
Probably.
Expand Down
9 changes: 1 addition & 8 deletions jo.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,15 +333,8 @@ char* locale_from_utf8(const char *utf8, size_t len)
char *stringify(JsonNode *json, int flags)
{
int pretty = flags & FLAG_PRETTY;
char *p, *spacer;

if ((p = getenv("JO_PRETTY")) != NULL)
pretty = TRUE;

if ((spacer = getenv("JO_SPACER")) == NULL)
spacer = SPACER;

return json_stringify(json, (pretty) ? spacer : NULL);
return json_stringify(json, (pretty) ? SPACER : NULL);
}

int version(int flags)
Expand Down
21 changes: 2 additions & 19 deletions jo.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
title: 'JO(1) User Manuals'
...

NAME
====

Expand Down Expand Up @@ -119,28 +115,14 @@ OPTIONS

-p
: Pretty-print the JSON string on output instead of the terse one-line
output it prints by default. (See `$JO_PRETTY` and `$JO_SPACER`
below.)
output it prints by default.

-v
: Show version and exit.

-V
: Show version as a JSON object and exit.

ENVIRONMENT
===========

*jo* attempts to use the following variables from its environment:

JO\_PRETTY
: If this variable is set to any value, *jo* will pretty-print on
output without having to specify `-p`.

JO\_SPACER
: When pretty-printing, *jo* uses three spaces by default. Set this
variable to any number of spaces or tabs to use instead.

BUGS
====

Expand Down Expand Up @@ -190,3 +172,4 @@ AUTHOR
======

Jan-Piet Mens <http://jpmens.net>

13 changes: 1 addition & 12 deletions jo.pandoc
Original file line number Diff line number Diff line change
Expand Up @@ -102,25 +102,14 @@ Elements (objects and arrays) can be nested. The following example nests an arra

-p
: Pretty-print the JSON string on output instead of the terse one-line output it
prints by default. (See `$JO_PRETTY` and `$JO_SPACER` below.)
prints by default.

-v
: Show version and exit.

-V
: Show version as a JSON object and exit.

# ENVIRONMENT

*jo* attempts to use the following variables from its environment:

JO_PRETTY
: If this variable is set to any value, *jo* will pretty-print on output without having to specify `-p`.


JO_SPACER
: When pretty-printing, *jo* uses three spaces by default. Set this variable to any number of spaces or tabs to use instead.

# BUGS

Probably.
Expand Down
2 changes: 1 addition & 1 deletion tests/jo.01.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# basic logo
unset JO_PRETTY; $JOBIN -a jo
$JOBIN -a jo
2 changes: 1 addition & 1 deletion tests/jo.02.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# basic logo (stdin)
unset JO_PRETTY; (echo jo | $JOBIN -a)
echo jo | $JOBIN -a
2 changes: 1 addition & 1 deletion tests/jo.03.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# basic two values
unset JO_PRETTY; $JOBIN pass=true type=text
$JOBIN pass=true type=text
2 changes: 1 addition & 1 deletion tests/jo.04.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# nested with executable
unset JO_PRETTY; $JOBIN name="Jane Jolie" data="$($JOBIN age= country=ES)"
$JOBIN name="Jane Jolie" data="$($JOBIN age= country=ES)"

# the double quotes around data are required for OpenBSD 5.8
# which mucks up the input with its pdksh otherwise
2 changes: 1 addition & 1 deletion tests/jo.05.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# nested native
unset JO_PRETTY; $JOBIN a[]=1 a[]=2 geo[lat]=111 geo[lon]=222
$JOBIN a[]=1 a[]=2 geo[lat]=111 geo[lon]=222
2 changes: 1 addition & 1 deletion tests/jo.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# be a comment and is used as the name of the test:
#
# # basic logo
# unset JO_PRETTY; $JOBIN -a jo
# $JOBIN -a jo
#
# the expect file (jo.??.exp) is a file which will be diff'd
# against the output of the corresponding .in file:
Expand Down

0 comments on commit 2a9aa61

Please sign in to comment.