diff --git a/README.md b/README.md index 212441e..4571b62 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,29 @@ A Rust port of the `which` utility. Locates an executable in the user's path. +## Usage + +```toml +[dependencies] +which = "1.0" +``` + +```rust +extern crate which; + +use which::which; + +fn main() { + assert_eq!( + which("sh"), + Some("/bin/sh".into())); + + assert_eq!( + which("foobar"), + None); +} +``` + ## License Licensed under either of -- 2.51.2 From 13a38a8dad4e36820725ac48ca4fa0ff8eb81d89 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Sun, 24 Apr 2016 22:57:42 -0400 Subject: [PATCH 2/2] Add note about platform compatibility. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4571b62..81ee902 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ A Rust port of the `which` utility. Locates an executable in the user's path. +*Note: rust-which currently only works on Unix-like operating systems.* + ## Usage ```toml