1 unstable release
Uses old Rust 2015
0.1.0 | Jan 17, 2018 |
---|
#303 in #account
9KB
142 lines
pit-rs
Usage
[dependencies]
pit = { git = "https://github.com/hhatto/pit-rs", branch = "master" }
extern crate pit;
use pit::Pit;
fn main() {
let p = Pit::new();
let config = p.get("twitter.com");
match config {
None => {
println!("not provide config value");
return;
},
Some(_) => {},
}
let config = config.unwrap();
let username = config.get("username").unwrap();
let password = config.get("password").unwrap();
println!("username={}, password={}", username, password);
}
for developer
$ cargo test -- --test-threads=1
lib.rs
:
pit
pit is account management tool.
Usage
[dependencies]
pit = "*"
$ mkdir -p ~/.pit
$ echo "profile: default" > ~/.pit/pit.yaml
$ echo "twitter.com:" >> ~/.pit/default.yaml
$ echo " username: foo" >> ~/.pit/default.yaml
$ echo " password: bar" >> ~/.pit/default.yaml
extern crate pit;
use pit::Pit;
fn main() {
let p = Pit::new();
let config = p.get("twitter.com");
match config {
None => {
println!("not provide config value");
return;
},
Some(_) => {},
}
let config = config.unwrap();
let username = config.get("username").unwrap();
let password = config.get("password").unwrap();
println!("username={}, password={}", username, password);
}
Dependencies
~140KB