node-dhcp
node-dhcp copied to clipboard
Add reasonable cli output
I removed the debug output, dhcp.js was producing. But I liked it to see what the server/client is actual doing. I think exposing a state event to show the process, the server/client is in, would make sense.
If we have this, a reasonable cli output should be made. Maybe with several verbosity levels.
I like the ideia 👍
I propose the following format:
$ dhcpd --verbose --foo --bar
Received DHCPDISCOVER from 12-34-56-78-90-98
Send DHCPOFFER to 12-34-56-78-90-98
- address: 192.168.0.66
- netmask: 255.255.255.128
- router: 192.168.0.1
Received DHCPREQUEST from 12-34-56-78-90-98
Send DHCPACK to 12-34-56-78-90-98
- address: 192.168.0.66
- netmask: 255.255.255.128
- router: 192.168.0.1
Active Leases: 17
In non-verbose mode, I would output nothing at all, since it's a daemon. But #14 should come.
On the client side it's ok to simply print the config for the moment. This can be analyzed with AWK or something and applied to the local system if wanted.