diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2019-06-12 14:40:56 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2019-06-12 14:41:55 +0200 |
commit | 3404e82e40ffd1055d89d72abe0e36bc8b24a656 (patch) | |
tree | 0580021f778a93021fed11febfe8082601a29949 /examples/zot/item.rs | |
parent | 2f600bea194b053b310a181857c5d801471fe7be (diff) | |
download | rust-zotapi-3404e82e40ffd1055d89d72abe0e36bc8b24a656.tar.gz rust-zotapi-3404e82e40ffd1055d89d72abe0e36bc8b24a656.tar.bz2 rust-zotapi-3404e82e40ffd1055d89d72abe0e36bc8b24a656.zip |
zotcli: Handle attaching media to posts.
Diffstat (limited to 'examples/zot/item.rs')
-rw-r--r-- | examples/zot/item.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/zot/item.rs b/examples/zot/item.rs index 5c3bd40..eb9013f 100644 --- a/examples/zot/item.rs +++ b/examples/zot/item.rs @@ -21,10 +21,15 @@ use zotapi; pub fn post(client: &zotapi::Client, args: &ArgMatches) { let mut msg = client.item(); msg.body(args.value_of("BODY").unwrap()); - if let Some(title) = args.value_of("TITLE") { + + if let Some(title) = dbg!(args.value_of("TITLE")) { msg.title(title); } + if let Some(file) = dbg!(args.value_of("ATTACH")) { + msg.file(file); + } + match msg.create() { Ok(payload) => { println!("Raw payload: {}", payload); |