Skip to content

Commit d8e47a8

Browse files
Make binaries examples (#123)
1 parent c0a6b6d commit d8e47a8

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

Cargo.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ macosx_10_9 = ["macosx_10_7"]
2222
name = "libproc"
2323
path = "src/lib.rs"
2424

25-
[[bin]]
26-
name = "procinfo"
27-
path = "src/procinfo.rs"
28-
29-
[[bin]]
30-
name = "dmesg"
31-
path = "src/dmesg.rs"
32-
3325
[build-dependencies]
3426
bindgen = { version = "0.69.0", default-features = false, features = ["runtime"] }
3527

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@ pub fn pidrusage<T: PIDRUsage>(pid : i32) -> Result<T, String> (macos)
7474
pub fn kmsgbuf() -> Result<String, String>
7575
```
7676

77-
# Binaries
78-
`cargo build` builds the following binaries:
79-
- `procinfo` that takes a PID as an optional argument (uses it's own pid if none supplied) and returns information about the process on stdout
80-
- `dmesg` is a version of dmesg implemented in rust that uses libproc-rs.
81-
8277
# Rust Versions
8378
The Github Actions CI matrix tests for rust `stable`, `beta` and `nightly` on all platforms
8479

@@ -104,6 +99,17 @@ To build for versions prior to Mac OS 10.7 disable the default features by passi
10499
To build for Mac OS X 10.7 (or 10.8) you can enable that feature alone using
105100
--no-default-features --features "macosx_10_7"
106101

102+
# Examples
103+
Two simple examples are included to show libproc-rs working.
104+
105+
- `procinfo` that takes a PID as an optional argument (uses it's own pid if none supplied) and returns
106+
information about the process on stdout
107+
- `dmesg` is a version of dmesg implemented in rust that uses libproc-rs.
108+
109+
These can be ran thus:
110+
`sudo cargo run --example procinfo` or
111+
`sudo cargo run --example dmesg`
112+
107113
# Build and Test Locally
108114
`cargo test` should build and test as usual for rust projects.
109115

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)