From 80de7ed5cb926d308a5bb7c645bd17e77b482428 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 27 Jul 2022 08:27:28 -0700 Subject: [PATCH] version bump. locale info changes. add ip-address parser --- CHANGELOG | 4 ++++ jc/cli.py | 4 ++-- jc/lib.py | 3 ++- setup.py | 2 +- templates/readme_template | 9 +++++---- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 916d5ff4..81818ca8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ jc changelog +xxxxxxxx v1.20.5 +- Add IP Address string parser +- Change LANG=C to LC_ALL=C in locale instructions + 20220723 v1.20.4 - Fix URL string parser path list for URLs ending in a forward slash diff --git a/jc/cli.py b/jc/cli.py index 19f52b31..7264b50f 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -638,7 +638,7 @@ def main(): utils.error_message([ f'Parser issue with {parser_name}:', f'{e.__class__.__name__}: {e}', - 'If this is the correct parser, try setting the locale to C (LANG=C).', + 'If this is the correct parser, try setting the locale to C (LC_ALL=C).', f'For details use the -d or -dd option. Use "jc -h --{parser_name}" for help.' ]) sys.exit(combined_exit_code(magic_exit_code, JC_ERROR_EXIT)) @@ -654,7 +654,7 @@ def main(): utils.error_message([ f'{parser_name} parser could not parse the input data.', f'{streaming_msg}', - 'If this is the correct parser, try setting the locale to C (LANG=C).', + 'If this is the correct parser, try setting the locale to C (LC_ALL=C).', f'For details use the -d or -dd option. Use "jc -h --{parser_name}" for help.' ]) sys.exit(combined_exit_code(magic_exit_code, JC_ERROR_EXIT)) diff --git a/jc/lib.py b/jc/lib.py index 9db1d5aa..e554fbd9 100644 --- a/jc/lib.py +++ b/jc/lib.py @@ -6,7 +6,7 @@ import importlib from typing import Dict, List, Iterable, Union, Iterator from jc import appdirs -__version__ = '1.20.4' +__version__ = '1.20.5' parsers = [ 'acpi', @@ -50,6 +50,7 @@ parsers = [ 'ini', 'iostat', 'iostat-s', + 'ip-address', 'iptables', 'iso-datetime', 'iw-scan', diff --git a/setup.py b/setup.py index 6a12598c..5f39bc3c 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open('README.md', 'r') as f: setuptools.setup( name='jc', - version='1.20.4', + version='1.20.5', author='Kelly Brazil', author_email='kellyjonbrazil@gmail.com', description='Converts the output of popular command-line tools and file-types to JSON.', diff --git a/templates/readme_template b/templates/readme_template index 8f5c6e96..1db104f2 100644 --- a/templates/readme_template +++ b/templates/readme_template @@ -322,15 +322,16 @@ Local plugins may override default parsers. #### Locale -For best results set the `LANG` locale environment variable to `C` or -`en_US.UTF-8`. For example, either by setting directly on the command-line: +For best results set the locale environment variables to `C` or +`en_US.UTF-8` by modifying the `LC_ALL` variable: ``` -$ LANG=C date | jc --date +$ LC_ALL=C date | jc --date ``` -or by exporting to the environment before running commands: +You can also set the locale variables individually: ``` $ export LANG=C +$ export LC_NUMERIC=C ``` On some older systems UTF-8 output will be downgraded to ASCII with `\\u`