diff options
author | Aram Drevekenin <aram@poor.dev> | 2019-12-30 21:41:19 +0100 |
---|---|---|
committer | Aram Drevekenin <aram@poor.dev> | 2019-12-30 21:41:19 +0100 |
commit | 92f0872ec3e4dcf58a5aed1ed8e111a71e4cf273 (patch) | |
tree | dfabcb50dc36cc871043511b961ff4300f0fc48a | |
parent | a935397e66c96d989e7b81157ee603b0a58664d2 (diff) |
chore(rename): what ==> bandwhich
-rw-r--r-- | Cargo.lock | 48 | ||||
-rw-r--r-- | Cargo.toml | 4 | ||||
-rw-r--r-- | PKGBUILD | 8 | ||||
-rw-r--r-- | README.md | 19 | ||||
-rw-r--r-- | docs/bandwhich.1 (renamed from docs/what.1) | 10 | ||||
-rw-r--r-- | src/main.rs | 4 |
6 files changed, 47 insertions, 46 deletions
@@ -79,6 +79,30 @@ dependencies = [ ] [[package]] +name = "bandwhich" +version = "0.6.0" +dependencies = [ + "async-trait 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "cargo-insta 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "insta 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ipnetwork 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "packet-builder 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_base 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "procfs 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "signal-hook 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "structopt 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "termion 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "trust-dns-resolver 0.18.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tui 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "bitflags" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1646,30 +1670,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "what" -version = "0.5.1" -dependencies = [ - "async-trait 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "cargo-insta 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "insta 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ipnetwork 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "packet-builder 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pnet 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pnet_base 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", - "procfs 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "signal-hook 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", - "structopt 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "termion 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "trust-dns-resolver 0.18.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tui 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] name = "widestring" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1,8 +1,8 @@ [package] edition = "2018" -name = "what" +name = "bandwhich" description = "Display current network utilization by process, connection and remote IP/hostname" -version = "0.5.1" +version = "0.6.0" homepage = "https://github.com/imsnif/what" repository = "https://github.com/imsnif/what" readme = "README.md" @@ -1,11 +1,11 @@ # Maintainer: Aram Drevekenin <aram@poor.dev> -pkgname=what +pkgname=bandwhich pkgver=0.3.7 pkgrel=2 makedepends=('rust' 'cargo') arch=('i686' 'x86_64' 'armv6h' 'armv7h') pkgdesc="Display network utilization by process, connection and remote address" -url="https://github.com/imsnif/what" +url="https://github.com/imsnif/bandwhich" source=("https://github.com/imsnif/$pkgname/archive/$pkgver.tar.gz") license=('MIT') sha256sums=("b60f002bd095cad88dd1cd1b4bcbcf65482e52d73fdff961455133b8a4ee4666") @@ -22,7 +22,7 @@ build() { package() { cd "$pkgname-$pkgver" - install -Dm755 "target/release/what" "$pkgdir/usr/bin/what" - install -Dm644 "docs/what.1" "$pkgdir/usr/share/man/man1/what.1" + install -Dm755 "target/release/bandwhich" "$pkgdir/usr/bin/bandwhich" + install -Dm644 "docs/bandwhich.1" "$pkgdir/usr/share/man/man1/bandwhich.1" install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE" } @@ -1,25 +1,26 @@ -## what -...is taking up my bandwidth?! +## bandwhich + +(formerly known as "what") ![demo](demo.gif) This is a CLI utility for displaying current network utilization by process, connection and remote IP/hostname ### How does it work? -`what` sniffs a given network interface and records IP packet size, cross referencing it with the `/proc` filesystem on linux or `lsof` on MacOS. It is responsive to the terminal window size, displaying less info if there is no room for it. It will also attempt to resolve ips to their host name in the background using reverse DNS on a best effort basis. +`bandwhich` sniffs a given network interface and records IP packet size, cross referencing it with the `/proc` filesystem on linux or `lsof` on MacOS. It is responsive to the terminal window size, displaying less info if there is no room for it. It will also attempt to resolve ips to their host name in the background using reverse DNS on a best effort basis. ### Installation #### Arch Linux ``` -yay -S what +yay -S bandwhich ``` #### MacOS and other Linux flavours ``` -cargo install what +cargo install bandwhich ``` If you're on linux, you could also get the generic binary from the releases. @@ -29,7 +30,7 @@ Windows is not supported at the moment - if you'd like to contribute a windows p ### Usage ``` USAGE: - what [FLAGS] [OPTIONS] + bandwhich [FLAGS] [OPTIONS] FLAGS: -h, --help Prints help information @@ -41,12 +42,12 @@ OPTIONS: -i, --interface <interface> The network interface to listen on, eg. eth0 ``` -Note that since `what` sniffs network packets, it requires root privileges - so you might want to use it with (for example) `sudo`. +Note that since `bandwhich` sniffs network packets, it requires root privileges - so you might want to use it with (for example) `sudo`. ### raw_mode -`what` also supports an easier-to-parse mode that can be piped or redirected to a file. For example, try: +`bandwhich` also supports an easier-to-parse mode that can be piped or redirected to a file. For example, try: ``` -what --raw | grep firefox +bandwhich --raw | grep firefox ``` ### Contributing Contributions of any kind are very welcome. If you'd like a new feature (or found a bug), please open an issue or a PR. diff --git a/docs/what.1 b/docs/bandwhich.1 index f69159f..c192f0f 100644 --- a/docs/what.1 +++ b/docs/bandwhich.1 @@ -1,11 +1,11 @@ -.TH WHAT 1 -.SH WHAT -what \- display current network utilization by process, connection and remote IP/hostname +.TH BANDWHICH 1 +.SH BANDWHICH +bandwhich \- display current network utilization by process, connection and remote IP/hostname .SH SYNOPSIS -.B what +.B bandwhich \fB\-i\fR \fIINTERFACE_NAME\fR .SH DESCRIPTION -.B what +.B bandwhich provides a responsive terminal dashboard for displaying bandwidth information. It sniffs a given network interface and cross references it with the /proc filesystem. Optionally, it has a raw mode that can be used to parse and log this data. .SH OPTIONS diff --git a/src/main.rs b/src/main.rs index dc8c4c5..77424c2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,7 +34,7 @@ use structopt::StructOpt; const DISPLAY_DELTA: time::Duration = time::Duration::from_millis(1000); #[derive(StructOpt, Debug)] -#[structopt(name = "what")] +#[structopt(name = "bandwhich")] pub struct Opt { #[structopt(short, long)] /// The network interface to listen on, eg. eth0 @@ -72,7 +72,7 @@ fn try_main() -> Result<(), failure::Error> { start(terminal_backend, os_input, opts); } Err(_) => failure::bail!( - "Failed to get stdout: 'what' does not (yet) support piping, is it being piped?" + "Failed to get stdout: if you are trying to pipe 'bandwhich' you should use the --raw flag" ), } } |