Consider the following:
hosts add --auto-sudo 127.0.0.1 cdn.cubing.net
sudo -k # clear `sudo`
hosts add --auto-sudo 127.0.0.1 cdn.cubing.net
Since adding a host is idempotent, the second invocation doesn't change the /etc/hosts file, and hosts can tell this without asking for sudo. It would be nice if --auto-sudo was a little smarter and avoided the prompt. (In fact, that was sort of my assumption based on the name.)
Consider the following:
hosts add --auto-sudo 127.0.0.1 cdn.cubing.net sudo -k # clear `sudo` hosts add --auto-sudo 127.0.0.1 cdn.cubing.netSince adding a host is idempotent, the second invocation doesn't change the
/etc/hostsfile, andhostscan tell this without asking forsudo. It would be nice if--auto-sudowas a little smarter and avoided the prompt. (In fact, that was sort of my assumption based on the name.)