Skip to content

Commit

Permalink
Merge pull request #21 from jacobtread/windows-support
Browse files Browse the repository at this point in the history
Windows support
  • Loading branch information
jkfran authored May 12, 2023
2 parents ad46b3e + 6e4079f commit 760d115
Show file tree
Hide file tree
Showing 5 changed files with 438 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 25 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ procfs = "0.15.1"
libproc = "0.13.0"
libc = "0.2"

[target.'cfg(target_os = "windows")'.dependencies.windows-sys]
version = "0.48"
features = [
"Win32_Foundation",
"Win32_NetworkManagement_IpHelper",
"Win32_System_Threading",
"Win32_Networking_WinSock",
"Win32_System_Diagnostics_ToolHelp",
]

[dev-dependencies]
assert_cmd = "2.0.10"
tempfile = "3.4.0"
Expand All @@ -39,9 +49,21 @@ depends = "$auto"
section = "admin"
priority = "optional"
assets = [
["target/release/killport", "usr/bin/", "755"],
["README.md", "usr/share/doc/killport/", "644"],
["LICENSE", "usr/share/doc/killport/", "644"],
[
"target/release/killport",
"usr/bin/",
"755",
],
[
"README.md",
"usr/share/doc/killport/",
"644",
],
[
"LICENSE",
"usr/share/doc/killport/",
"644",
],
]

[target.aarch64-unknown-linux-gnu]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

# killport

`killport` is a command-line utility for killing processes listening on specific ports. It's designed to be simple, fast, and effective. The tool is built with Rust and works on Linux and macOS.
`killport` is a command-line utility for killing processes listening on specific ports. It's designed to be simple, fast, and effective. The tool is built with Rust and works on Linux, macOS, and Windows.

## Features

Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
mod linux;
#[cfg(target_os = "macos")]
mod macos;
#[cfg(target_os = "windows")]
mod windows;

#[cfg(target_os = "linux")]
use linux::kill_processes_by_port;
#[cfg(target_os = "macos")]
use macos::kill_processes_by_port;
#[cfg(target_os = "windows")]
use windows::kill_processes_by_port;

use clap::{Parser, ValueEnum};
use clap_verbosity_flag::{Verbosity, WarnLevel};
Expand Down
Loading

0 comments on commit 760d115

Please sign in to comment.