Skip to content

Commit c0a50e2

Browse files
author
Sean Gillies
committed
Make feature sequences the default
Resolves #19
1 parent 892bd5b commit c0a50e2

File tree

4 files changed

+14
-19
lines changed

4 files changed

+14
-19
lines changed

README.rst

+4-5
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,10 @@ or, optionally, a sequence of individual features. Since most software that
7676
reads and writes GeoJSON expects a text containing a single feature collection,
7777
that's the default, and a LF-delimited sequence of texts containing one GeoJSON
7878
feature each is a feature that is turned on using the ``--sequence`` option.
79-
To write sequences of feature texts that conform to the `JSON Text Sequences
80-
proposed standard
81-
<http://tools.ietf.org/html/draft-ietf-json-text-sequence-13>`__ (and might
82-
contain pretty-printed JSON) with the ASCII Record Separator (0x1e) as
83-
a delimiter, use the ``--rs`` option
79+
To write sequences of feature texts that conform to the `RFC 7464 JSON Text
80+
Sequences standard <https://tools.ietf.org/html/rfc7464>`__ (and might contain
81+
pretty-printed JSON) with the ASCII Record Separator (0x1e) as a delimiter, use
82+
the ``--rs`` option
8483

8584
.. code-block:: python
8685

cligj/__init__.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from .features import normalize_feature_inputs
88

9+
910
# Arguments.
1011

1112
# Multiple input files.
@@ -95,18 +96,17 @@
9596
# Feature collection or feature sequence switch.
9697
sequence_opt = click.option(
9798
'--sequence/--no-sequence',
98-
default=False,
99+
default=True,
99100
help="Write a LF-delimited sequence of texts containing individual "
100-
"objects or write a single JSON text containing a feature "
101-
"collection object (the default).")
101+
"objects (the default) or write a single JSON text containing a "
102+
"feature collection object.")
102103

103104
use_rs_opt = click.option(
104105
'--rs/--no-rs',
105106
'use_rs',
106107
default=False,
107108
help="Use RS (0x1E) as a prefix for individual texts in a sequence "
108-
"as per http://tools.ietf.org/html/draft-ietf-json-text-sequence-13 "
109-
"(default is False).")
109+
"as per https://tools.ietf.org/html/rfc7464 (default is False).")
110110

111111

112112
# GeoJSON output mode option.
@@ -119,7 +119,7 @@ def geojson_type_collection_opt(default=False):
119119
help="Output as GeoJSON feature collection(s).")
120120

121121

122-
def geojson_type_feature_opt(default=False):
122+
def geojson_type_feature_opt(default=True):
123123
return click.option(
124124
'--feature',
125125
'geojson_type',

setup.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
setup(name='cligj',
11-
version='0.4.0',
11+
version='0.5.0',
1212
description=u"Click params for commmand line interfaces to GeoJSON",
1313
long_description=long_description,
1414
classifiers=[],
@@ -20,9 +20,5 @@
2020
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
2121
include_package_data=True,
2222
zip_safe=False,
23-
install_requires=[
24-
'click>=4.0'
25-
],
26-
extras_require={
27-
'test': ['pytest-cov'],
28-
})
23+
install_requires=['click>=4.0'],
24+
extras_require={'test': ['pytest-cov']})

tests/test_cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def cmd(sequence):
163163

164164
result = runner.invoke(cmd)
165165
assert not result.exception
166-
assert result.output.splitlines() == ['False']
166+
assert result.output.splitlines() == ['True']
167167

168168
result = runner.invoke(cmd, ['--sequence'])
169169
assert not result.exception

0 commit comments

Comments
 (0)