credmp / hed

Hosts EDitor, it will add/update/delete host entries for you
https://www.arjenwiersma.nl
GNU General Public License v3.0
13 stars 3 forks source link

When adding a host domain, optimize the hostentry #5

Closed credmp closed 2 years ago

credmp commented 2 years ago

When adding example.com when a subdomain demo.example.com already exists, make the top level entry the name and move the subdomain to aliasses.

./hed --file test.txt show
Reading file test.txt
10.10.10.10 demo.example.com    
 ~/Downloads $ ./hed --file test.txt add example.com 
Reading file test.txt
Error: 
   0: Could not add host, no parent domain to resolve it.

Location:
   src/main.rs:177

Backtrace omitted.
Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.