From b953b79f9c46d8c5398a6c1c2769167b5aed2805 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 5 Nov 2019 17:04:18 -0600 Subject: [PATCH] add compatibility --- jc/parsers/arp.py | 3 +++ jc/parsers/df.py | 4 ++++ jc/parsers/ls.py | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/jc/parsers/arp.py b/jc/parsers/arp.py index 70b9898e..064c51a6 100644 --- a/jc/parsers/arp.py +++ b/jc/parsers/arp.py @@ -78,6 +78,7 @@ $ arp -a | jc --arp -p -r } ] """ +import jc def process(proc_data): @@ -103,6 +104,8 @@ def process(proc_data): def parse(data, raw=False): + jc.jc.compatibility(__name__, + ['linux']) # code adapted from Conor Heine at: # https://gist.github.com/cahna/43a1a3ff4d075bcd71f9d7120037a501 diff --git a/jc/parsers/df.py b/jc/parsers/df.py index dfe28982..b05dc7b4 100644 --- a/jc/parsers/df.py +++ b/jc/parsers/df.py @@ -63,6 +63,7 @@ $ df | jc --df -p -r ... ] """ +import jc def process(proc_data): @@ -106,6 +107,9 @@ def process(proc_data): def parse(data, raw=False): + jc.jc.compatibility(__name__, + ['linux']) + cleandata = data.splitlines() fix_headers = cleandata[0].lower().replace('avail ', 'available ') fix_headers = fix_headers.replace('use%', 'use_percent') diff --git a/jc/parsers/ls.py b/jc/parsers/ls.py index 5f3360e9..4469494d 100644 --- a/jc/parsers/ls.py +++ b/jc/parsers/ls.py @@ -135,6 +135,7 @@ $ ls -l /usr/bin | jc --ls | jq '.[] | select(.size > 50000000)' } """ import re +import jc def process(proc_data): @@ -165,6 +166,9 @@ def process(proc_data): def parse(data, raw=False): + jc.jc.compatibility(__name__, + ['linux', 'darwin']) + raw_output = [] linedata = data.splitlines()