1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-23 00:29:59 +02:00

doc update

This commit is contained in:
Kelly Brazil
2024-06-07 17:42:30 -07:00
parent 7d8166326a
commit a92e318319
4 changed files with 28 additions and 6 deletions

View File

@ -1,10 +1,11 @@
jc changelog
20240510 v1.25.3
20240607 v1.25.3
- Enhance `bluetoothctl` parser with added `battery_percentage` field
- Enhance `git-log` standard and streaming parsers with added `lines_changed` field under `file_stats`
- Fix `pci-ids` parser to correctly handle multiple subdevices
- Fix `pip-show` parser to handle multi-line fields with a beginning blank line
- Fix `ss` parser to correctly handle the `Recv-Q` field being too close to the `Status` field
- Fix `top` parsers to quiet uptime info parsing
- Fix `traceroute` parser to correctly handle hops with multiple IPs
- Fix `zpool-status` parser for config items lacking data values

View File

@ -47,6 +47,13 @@ field names
"file_descriptor": string
}
}
"inode_number": string,
"cookie": string,
"cgroup": string,
"v6only": string,
"timer_name": string,
"expire_time": string,
"retrans": string
}
}
]
@ -310,4 +317,4 @@ Compatibility: linux
Source: [`jc/parsers/ss.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/ss.py)
Version 1.7 by Kelly Brazil (kellyjonbrazil@gmail.com)
Version 1.8 by Kelly Brazil (kellyjonbrazil@gmail.com)

View File

@ -42,6 +42,13 @@ field names
"file_descriptor": string
}
}
"inode_number": string,
"cookie": string,
"cgroup": string,
"v6only": string,
"timer_name": string,
"expire_time": string,
"retrans": string
}
}
]
@ -344,13 +351,16 @@ def _parse_opts(proc_data):
"""
o_field = proc_data.split(' ')
opts = {}
for item in o_field:
# -e option:
item = re.sub(
'uid', 'uid_number',
re.sub('sk', 'cookie', re.sub('ino', 'inode_number', item)))
if ":" in item:
key, val = item.split(':')
# -o option
if key == "timer":
val = val.replace('(', '[').replace(')', ']')
@ -361,6 +371,7 @@ def _parse_opts(proc_data):
'retrans': val[2]
}
opts[key] = val
# -p option
if key == "users":
key = 'process_id'
@ -380,7 +391,9 @@ def _parse_opts(proc_data):
}
})
val = data
opts[key] = val
return opts
def parse(data, raw=False, quiet=False):
@ -453,6 +466,7 @@ def parse(data, raw=False, quiet=False):
entry_list.insert(7, p_port)
if re.search(r'ino:|uid:|sk:|users:|timer:|cgroup:|v6only:', entry_list[-1]):
if header_list[-1] != 'opts':
header_list.append('opts')
entry_list[-1] = _parse_opts(entry_list[-1])

View File

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