Reorganise & cleanup (#329)

* Get rid of outdated, unused packaging files

* Create `/res`
This commit is contained in:
cyqsimon
2023-11-02 00:59:56 +08:00
committed by GitHub
parent 022eade156
commit cf9b9f0634
10 changed files with 1 additions and 212 deletions

13
.gitignore vendored
View File

@@ -1,14 +1 @@
.cargo/
target/ target/
vendor/
vendor.tar
**/*.rs.bk
# Debian support
debian/*
!debian/changelog
!debian/control
!debian/copyright
!debian/rules
!debian/source

View File

@@ -1,58 +0,0 @@
prefix ?= /usr/local
TARGET=debug
DEBUG ?= 0
ifeq ($(DEBUG),0)
TARGET = release
ARGS = --release
endif
VENDOR ?= 0
ifeq ($(VENDOR),1)
ARGS += --frozen
endif
APP=bandwhich
BIN=target/$(TARGET)/$(APP)
BIN_DST=$(DESTDIR)$(prefix)/bin/$(APP)
DOC_DST=$(DESTDIR)$(prefix)/share/man/man1/bandwhich.1
LIC_DST=$(DESTDIR)$(prefix)/share/licenses/$(APP)
AUTOCOMPLETE_DST=$(DESTDIR)$(prefix)/share/bash-completion/completions
SRC = Makefile Cargo.lock Cargo.toml $(shell find src -type f -wholename 'src/*.rs')
.PHONY: all clean distclean install uninstall vendor install_autocomplete
all: $(BIN)
clean:
cargo clean
distclean:
rm -rf .cargo vendor vendor.tar
$(BIN): $(SRC)
ifeq ($(VENDOR),1)
tar pxf vendor.tar
endif
cargo build $(ARGS)
install_autocomplete:
mkdir -p $(AUTOCOMPLETE_DST)
cp completion/bandwhich $(AUTOCOMPLETE_DST)/bandwhich
uninstall_autocomplete:
rm -f $(AUTOCOMPLETE_DST)/bandwhich
install: install_autocomplete
install -Dm755 $(BIN) $(BIN_DST)
install -Dm644 docs/bandwhich.1 $(DOC_DST)
install -Dm644 LICENSE.md $(LIC_DST)/LICENSE
uninstall: uninstall_autocomplete
rm -rf $(BIN_DST) $(DOC_DST) $(LIC_DST)
vendor:
mkdir -p .cargo
cargo vendor | head -n -1 > .cargo/config
echo 'directory = "vendor"' >> .cargo/config
tar pcf vendor.tar vendor

View File

@@ -1,6 +1,6 @@
# bandwhich # bandwhich
![demo](demo.gif) ![demo](res/demo.gif)
This is a CLI utility for displaying current network utilization by process, connection and remote IP/hostname This is a CLI utility for displaying current network utilization by process, connection and remote IP/hostname

View File

@@ -1,31 +0,0 @@
# bandwhich completion -*- shell-script -*-
_bandwhich()
{
local cur prev flags opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
flags="--addresses --connections --help --no-resolve
--processes --raw --show-dns --total-utilization --version"
opts="--dns-server --interface"
interfaces=$(ip link show | grep -o ": .*:" | sed 's/[: ]//g' | tr '\n' ' ')
case "${prev}" in
--interface)
COMPREPLY=( $(compgen -W "${interfaces}" -- "${cur}"))
return
;;
esac
case "${cur}" in
--interface)
COMPREPLY=( $(compgen -W "${interfaces}"))
;;
-*)
COMPREPLY=( $(compgen -W "${flags} ${opts}" -- "${cur}"))
;;
esac
} &&
complete -o nospace -F _bandwhich bandwhich

5
debian/changelog vendored
View File

@@ -1,5 +0,0 @@
bandwhich (0.9.0) bionic; urgency=medium
* Initial debian packaging
-- Michael Aaron Murphy <michael@system76.com> Thu, 16 Jan 2020 8:26:58 -0700

17
debian/control vendored
View File

@@ -1,17 +0,0 @@
Source: bandwhich
Section: utils
Priority: optional
Maintainer: Michael Aaron Murphy <mmstick@pm.me>
Build-Depends:
cargo (>=0.40),
clang,
debhelper-compat (=9),
rustc (>=1.39)
Standards-Version: 4.4.1
Homepage: https://github.com/imsnif/bandwhich
Package: bandwhich
Architecture: any
Depends: ${misc:Depends}, ${shlib:Depends}
Description: Terminal bandwidth utilization tool
Terminal bandwidth utilization tool

22
debian/rules vendored
View File

@@ -1,22 +0,0 @@
#!/usr/bin/make -f
export VENDOR ?= 1
export prefix = /usr
CLEAN ?= 1
%:
dh $@
override_dh_auto_clean:
ifeq ($(CLEAN),1)
make clean;
endif
ifeq ($(VENDOR),1)
if ! ischroot; then \
make vendor; \
rm -rf vendor; \
fi
endif
override_dh_auto_build:
env CARGO_HOME="$$(pwd)/target/cargo" dh_auto_build

View File

@@ -1 +0,0 @@
3.0 (native)

View File

@@ -1,64 +0,0 @@
.TH BANDWHICH 1
.SH BANDWHICH
bandwhich \- display current network utilization by process, connection and remote IP/hostname
.SH SYNOPSIS
.B bandwhich
[\fIFLAGS\fR]
[\fIOPTIONS\fR]
.SH DESCRIPTION
.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. 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.
It has a raw mode that can be used to parse and log this data.
.SH FLAGS
.TP
.BR \-a ", " \-\-addresses
Show remote addresses table only
.TP
.BR \-c ", " \-\-connections
Show connections table only
.TP
.BR \-h ", " \-\-help
Prints help information
.TP
.BR \-n ", " \-\-no\-resolve
Do not attempt to resolve IPs to their hostnames
.TP
.BR \-p ", " \-\-processes
Show processes table only
.TP
.BR \-r ", " \-\-raw
Print output to STDOUT so it can be parsed or redirected.
.TP
.BR \-s ", " \-\-show-dns
Show DNS queries
.TP
.BR \-t ", " \-\-total-utilization
Show total (cumulative) usages
.TP
.BR \-V ", " \-\-version
Print version and exit
.SH OPTIONS
.TP
\fB \-i\fP, \fB\-\-interface\fP \fIinterface\fP
The network interface to listen on, eg. eth0
.SH COPYRIGHT
Copyright \(co 2019 Aram Drevekenin
License MIT: https://github.com/imsnif/bandwhich/blob/main/LICENSE.md
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH SEE ALSO
.BR iftop (1),
.BR lsof (1),
.BR nethogs (1),
.BR netstat (1),
.BR nload (1),
.BR ss (1),
.SH BUGS
Please report bugs here: https://github.com/imsnif/bandwhich/issues

View File

Before

Width:  |  Height:  |  Size: 3.5 MiB

After

Width:  |  Height:  |  Size: 3.5 MiB