aboutsummaryrefslogtreecommitdiff
path: root/mingling_picker/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'mingling_picker/README.md')
-rw-r--r--mingling_picker/README.md35
1 files changed, 35 insertions, 0 deletions
diff --git a/mingling_picker/README.md b/mingling_picker/README.md
index e69de29..efd72ad 100644
--- a/mingling_picker/README.md
+++ b/mingling_picker/README.md
@@ -0,0 +1,35 @@
+# Mingling Picker
+
+A command-line argument parser for [Mingling](https://github.com/mingling-rs/mingling), enabled by the `mingling/picker` feature.
+
+```toml
+[dependencies.mingling]
+version = "0.3.0"
+features = [
+ "picker"
+]
+```
+
+## Chained Argument Parser
+
+Provides a clean chained-call API for declaring arguments to parse:
+
+```rust
+let args: Vec<&str> = vec!["--name", "Bob", "--age", "24"];
+let result = args
+ .pick(&flag![name: String])
+ .or(|| "Alice".to_string())
+ .pick(&flag![age: i32])
+ .or(|| 24)
+ .post(|num| num.clamp(0, 120))
+ .parse();
+let (name, age): (String, i32) = a.unwrap();
+```
+
+## Parsing Function Library
+
+Provides a pure function library `parselib` for analyzing the structure of command-line arguments.
+
+```rust
+use mingling::picker::parselib::*;
+```