diff options
Diffstat (limited to 'src/bin/zot')
-rw-r--r-- | src/bin/zot/main.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/bin/zot/main.rs b/src/bin/zot/main.rs index a8451b2..70a7984 100644 --- a/src/bin/zot/main.rs +++ b/src/bin/zot/main.rs @@ -34,6 +34,10 @@ async fn main() { (version: crate_version!()) (author: crate_authors!()) (about: "zotapi command line client") + (@subcommand verify => + (about: "Verify") + (@arg raw: --raw "Display raw json payload") + ) (@subcommand channel => (about: "Fetch the channel stream") (@arg raw: --raw "Display raw json payload") @@ -72,12 +76,29 @@ async fn main() { (@arg ATTACH: --attach [FILE] "Attach a file or image to the post") (@arg GROUP: --group [groups] "Limit distribution to the specified group(s) separated by comma") ) + (@subcommand photos => + (about: "Post or get photos or albums") + (@arg UPLOAD: --upload [FILE] requires[ALBUM] "Upload a photo") + (@arg ALBUM: --album +takes_value "The album to upload the photo to") + (@arg DESC: --description +takes_value "A description/title for the photo") + (@arg BODY: --body +takes_value "A longer description/body text") + (@arg POST: --post "Post the photo to the timeline") + (@arg GROUP: --group [groups] "Limit distribution to the specified group(s) separated by comma") + ) ) .get_matches(); let client = zotapi::client(&site, &user, &password); match matches.subcommand() { + ("verify", Some(m)) => { + let r = zotapi::Channel::z(); + if m.is_present("raw") { + println!("{}", r.fetch_raw(&client).await.unwrap()); + } else { + println!("{:?}", r.fetch(&client).await); + } + } ("channel", Some(m)) => { let raw = m.is_present("raw"); zot::channel_stream::fetch(&client, raw).await; |