From 1908c08d6c0516e6a5dc39587ea80c85debd5832 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Sun, 24 Apr 2016 22:52:08 -0400 Subject: [PATCH] Add basic usage example to README. --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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