hc-rs 0.3.7

create hosts file
hc-rs-0.3.7 is not a library.

this is a WIP

whats done

  • fetching hosts files
  • merging hosts files
  • removing duplicate lines
  • cli options
  • colored output messages
  • configuration file
  • replace with /etc/hosts(i think this should be done manually though)

building from git source

$ git clone https://github.com/XDream8/hc-rs
$ cd hc-rs
$ cargo build --profile optimized
$ ./target/optimized/hc-rs

usage

$ hc-rs -h
$ hc-rs <flags> <urls>
$ hc-rs <subcommand> ...

creating a hosts file

  • pass urls directly to hc-rs
  • you can pass as much urls as you want to
$ hc-rs https://badmojr.github.io/1Hosts/Pro/hosts.txt https://hosts.oisd.nl

removing duplicate lines

use --remove-duplicates(-r) flag to remove duplicate lines from the downloaded content/hosts

$ hc-rs -r

removing duplicate lines from a already created hosts file

I added a subcommand just for this purpose

$ hc-rs rmd <files>

setting output filename

use --output(-o) flag to set output filename
default filename is "hosts"

$ hc-rs -o new-hosts

ignoring fetching errors

use --ignore-errors(-i) flag to ignore fetching errors and don't exit

$ hc-rs -i https://example.com/example

aliasing in your shell config

alias create-hosts='hc-rs -r https://badmojr.github.io/1Hosts/Pro/hosts.txt https://hosts.oisd.nl'