brona / iproute2mac

CLI wrapper for basic network utilites on Mac OS X inspired with iproute2 on Linux systems - ip command.
MIT License
898 stars 73 forks source link

Add support for -j (json) flag #49

Closed stewartadam closed 4 months ago

stewartadam commented 1 year ago

Modern versions of ip support a -j flag to output as machine-readable JSON, would be great to have this on MacOS too!

BloodyFrag commented 9 months ago

+1. This would be great for custom scripts.

signal-09 commented 5 months ago

I tried to implement it in 543fef9a9501ad782f03ad6d70f3c492e8b78ad2. It is a bit rudimental but working. Not all the macOS ifconfig and netstat outputs are parsed, but enough to make some other project to work (e.g. vagrant-libvirt/vagrant-libvirt#1205 mentioned above).