diff --git a/Cargo.toml b/Cargo.toml index 705edd9..399329a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fie" -version = "0.12.0" +version = "0.12.1" authors = ["Douman "] repository = "https://github.com/DoumanAsh/fie" description = "Small and cute social media utility." diff --git a/README.md b/README.md index 8361231..ea22768 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Build status](https://ci.appveyor.com/api/projects/status/oc937oppd38x1y4y/branch/master?svg=true)](https://ci.appveyor.com/project/DoumanAsh/fie/branch/master) [![Build Status](https://travis-ci.org/DoumanAsh/fie.svg?branch=master)](https://travis-ci.org/DoumanAsh/fie) [![Crates.io](https://img.shields.io/crates/v/fie.svg)](https://crates.io/crates/fie) -[![Dependency status](https://deps.rs/crate/fie/0.12.0/status.svg)](https://deps.rs/crate/fie) +[![Dependency status](https://deps.rs/crate/fie/0.12.1/status.svg)](https://deps.rs/crate/fie) Small and cute social media CLI. @@ -11,10 +11,10 @@ Small and cute social media CLI. ## Download links -* Windows [32bit](https://github.com/DoumanAsh/fie/releases/download/0.12.0/fie-0.12.0-i686-pc-windows-msvc.zip) -* Windows [64bit](https://github.com/DoumanAsh/fie/releases/download/0.12.0/fie-0.12.0-x86_64-pc-windows-msvc.zip) -* Linux [64bit](https://github.com/DoumanAsh/fie/releases/download/0.12.0/fie-0.12.0-x86_64-unknown-linux-gnu.zip) -* OSX [64bit](https://github.com/DoumanAsh/fie/releases/download/0.12.0/fie-0.12.0-x86_64-apple-darwin.zip) +* Windows [32bit](https://github.com/DoumanAsh/fie/releases/download/0.12.1/fie-0.12.1-i686-pc-windows-msvc.zip) +* Windows [64bit](https://github.com/DoumanAsh/fie/releases/download/0.12.1/fie-0.12.1-x86_64-pc-windows-msvc.zip) +* Linux [64bit](https://github.com/DoumanAsh/fie/releases/download/0.12.1/fie-0.12.1-x86_64-unknown-linux-gnu.zip) +* OSX [64bit](https://github.com/DoumanAsh/fie/releases/download/0.12.1/fie-0.12.1-x86_64-apple-darwin.zip) ## Supported social platforms: diff --git a/src/cli/main.rs b/src/cli/main.rs index 6411b0c..6a09e02 100644 --- a/src/cli/main.rs +++ b/src/cli/main.rs @@ -1,5 +1,7 @@ #![cfg_attr(feature = "cargo-clippy", allow(clippy::style))] +use serde_derive::Deserialize; + mod config; mod cli; @@ -67,7 +69,12 @@ fn handle_post_result(result: fie::api::PostResult) { handle_inner("Minds", minds); } -fn open_batch(path: &str) -> io::Result> { +#[derive(Deserialize, Debug)] +pub struct Batch { + post: Vec, +} + +fn open_batch(path: &str) -> io::Result { config::load_from_file(Path::new(path)) } @@ -83,7 +90,7 @@ fn run() -> io::Result<()> { cli::Command::Batch(batch) => { let api = create_api(config)?; - for (idx, post) in open_batch(&batch.file)?.drain(..).enumerate() { + for (idx, post) in open_batch(&batch.file)?.post.drain(..).enumerate() { println!(">>>Post #{}:", idx + 1); match api.send(post) { Ok(result) => handle_post_result(result),