1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-23 00:29:59 +02:00
This commit is contained in:
Kelly Brazil
2019-11-14 21:36:02 -08:00
parent 64016b8ef0
commit a3a8369dc0

View File

@ -5,11 +5,52 @@ Usage:
Examples:
$ hosts | jc --hosts -p
[]
$ hosts | jc --hosts -p -r
[]
$ cat /etc/hosts | jc --hosts -p
[
{
"ip": "127.0.0.1",
"hostname": [
"localhost"
]
},
{
"ip": "127.0.1.1",
"hostname": [
"kbrazil-ubuntu"
]
},
{
"ip": "::1",
"hostname": [
"ip6-localhost",
"ip6-loopback"
]
},
{
"ip": "fe00::0",
"hostname": [
"ip6-localnet"
]
},
{
"ip": "ff00::0",
"hostname": [
"ip6-mcastprefix"
]
},
{
"ip": "ff02::1",
"hostname": [
"ip6-allnodes"
]
},
{
"ip": "ff02::2",
"hostname": [
"ip6-allrouters"
]
}
]
"""
import jc.utils
@ -28,14 +69,15 @@ def process(proc_data):
[
{
"hosts": string,
"bar": boolean,
"baz": integer
"ip": string,
"hostname": [
string
]
}
]
"""
# rebuild output for added semantic information
# no additional processing needed
return proc_data