1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-25 00:37:31 +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: Examples:
$ hosts | jc --hosts -p $ cat /etc/hosts | jc --hosts -p
[] [
{
$ hosts | jc --hosts -p -r "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 import jc.utils
@ -28,14 +69,15 @@ def process(proc_data):
[ [
{ {
"hosts": string, "ip": string,
"bar": boolean, "hostname": [
"baz": integer string
]
} }
] ]
""" """
# rebuild output for added semantic information # no additional processing needed
return proc_data return proc_data