kellyjonbrazil / jc

CLI tool and python library that converts the output of popular command-line tools, file-types, and common strings to JSON, YAML, or Dictionaries. This allows piping of output to tools like jq and simplifying automation scripts.
MIT License
7.82k stars 202 forks source link

feat: Add Windows ipconfig parser to jc #596

Open joehacksalot opened 6 days ago

joehacksalot commented 6 days ago

This PR introduces a new parser for the Windows ipconfig command to address issue #594.

Tested on:

Also, manually modified the configuration of a windows VM to test for a multiple entries for:

Notes (copied from ipconfig.py:85):

[0] - 'lease_expires' and 'lease_obtained' are parsed to ISO8601 format date strings. if the value was unable 
        to be parsed by datetime, the fields will be in their raw form
[1] - 'autoconfigured' under 'ipv4_address' is only providing indication if the ipv4 address was labeled as
        "Autoconfiguration IPv4 Address" vs "IPv4 Address". It does not infer any information from other fields
[2] - Windows XP uses 'IP Address' instead of 'IPv4 Address'. Both values are parsed to the 'ipv4_address' 
        object for consistency

Closes #594

kellyjonbrazil commented 6 days ago

Nice contribution, thanks! I'll take a closer look in the next few days.

joehacksalot commented 6 days ago

Thanks! That preferred casing mismatch was a last minute change to restore status text to source casing (previously had it all lowercase). I'll update the tests shortly.

joehacksalot commented 6 days ago

Ok. Updates are in.