1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-08-06 22:32:54 +02:00

add compatibility

This commit is contained in:
Kelly Brazil
2019-11-05 17:04:18 -06:00
parent 7f99677806
commit b953b79f9c
3 changed files with 11 additions and 0 deletions

View File

@ -78,6 +78,7 @@ $ arp -a | jc --arp -p -r
} }
] ]
""" """
import jc
def process(proc_data): def process(proc_data):
@ -103,6 +104,8 @@ def process(proc_data):
def parse(data, raw=False): def parse(data, raw=False):
jc.jc.compatibility(__name__,
['linux'])
# code adapted from Conor Heine at: # code adapted from Conor Heine at:
# https://gist.github.com/cahna/43a1a3ff4d075bcd71f9d7120037a501 # https://gist.github.com/cahna/43a1a3ff4d075bcd71f9d7120037a501

View File

@ -63,6 +63,7 @@ $ df | jc --df -p -r
... ...
] ]
""" """
import jc
def process(proc_data): def process(proc_data):
@ -106,6 +107,9 @@ def process(proc_data):
def parse(data, raw=False): def parse(data, raw=False):
jc.jc.compatibility(__name__,
['linux'])
cleandata = data.splitlines() cleandata = data.splitlines()
fix_headers = cleandata[0].lower().replace('avail ', 'available ') fix_headers = cleandata[0].lower().replace('avail ', 'available ')
fix_headers = fix_headers.replace('use%', 'use_percent') fix_headers = fix_headers.replace('use%', 'use_percent')

View File

@ -135,6 +135,7 @@ $ ls -l /usr/bin | jc --ls | jq '.[] | select(.size > 50000000)'
} }
""" """
import re import re
import jc
def process(proc_data): def process(proc_data):
@ -165,6 +166,9 @@ def process(proc_data):
def parse(data, raw=False): def parse(data, raw=False):
jc.jc.compatibility(__name__,
['linux', 'darwin'])
raw_output = [] raw_output = []
linedata = data.splitlines() linedata = data.splitlines()