1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-13 01:20:24 +02:00

doc update

This commit is contained in:
Kelly Brazil
2024-06-09 10:31:06 -07:00
parent e13605a6a9
commit 0005945383
2 changed files with 6 additions and 4 deletions

View File

@ -415,6 +415,8 @@ def parse(data, raw=False, quiet=False):
contains_colon = ['nl', 'p_raw', 'raw', 'udp', 'tcp', 'v_str', 'icmp6']
raw_output = []
ONE_SPACE_PATTERN = r'[ ]{1,}'
TWO_SPACE_PATTERN = r'[ ]{2,}'
# Clear any blank lines
cleandata = list(filter(None, data.splitlines()))
@ -423,7 +425,7 @@ def parse(data, raw=False, quiet=False):
header_text = cleandata[0].lower()
# get the position of Recv-Q since sometimes it doesn't leave enough space
# to parse. need at least two spaces between main fields do differentiate
# to parse. need at least two spaces between main fields to differentiate
# from opt fields, which are only separated by one space
recv_q_position = header_text.find('recv-q')
@ -445,10 +447,10 @@ def parse(data, raw=False, quiet=False):
# fix weird ss bug where first two columns have no space between them sometimes
entry = entry[:5] + ' ' + entry[5:]
entry_list = re.split(r'[ ]{1,}', entry.strip())
entry_list = re.split(ONE_SPACE_PATTERN, entry.strip())
if len(entry_list) > len(header_list) or extra_opts == True:
entry_list = re.split(r'[ ]{2,}', entry.strip())
entry_list = re.split(TWO_SPACE_PATTERN, entry.strip())
extra_opts = True
if entry_list[0] in contains_colon and ':' in entry_list[4]:

View File

@ -1,4 +1,4 @@
.TH jc 1 2024-06-07 1.25.3 "JSON Convert"
.TH jc 1 2024-06-09 1.25.3 "JSON Convert"
.SH NAME
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types,
and strings