aboutsummaryrefslogtreecommitdiffstats
path: root/examples/zot
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2020-01-01 23:45:30 +0100
committerHarald Eilertsen <haraldei@anduin.net>2020-01-01 23:45:30 +0100
commitbee7318ca808d36b29cbf6021ec47252ab2305f8 (patch)
tree58c5859e1d97e0d38c3cca7fe93489508e38e64e /examples/zot
parent1fd9f311a55759a613e4df66d462a34102644380 (diff)
downloadrust-zotapi-bee7318ca808d36b29cbf6021ec47252ab2305f8.tar.gz
rust-zotapi-bee7318ca808d36b29cbf6021ec47252ab2305f8.tar.bz2
rust-zotapi-bee7318ca808d36b29cbf6021ec47252ab2305f8.zip
zotcli: Limit post to one or more groups.
Diffstat (limited to 'examples/zot')
-rw-r--r--examples/zot/item.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/zot/item.rs b/examples/zot/item.rs
index eb9013f..e848af2 100644
--- a/examples/zot/item.rs
+++ b/examples/zot/item.rs
@@ -30,6 +30,12 @@ pub fn post(client: &zotapi::Client, args: &ArgMatches) {
msg.file(file);
}
+ if let Some(groups) = dbg!(args.value_of("GROUP")) {
+ for g in groups.split(",") {
+ msg.group_allow(g);
+ }
+ }
+
match msg.create() {
Ok(payload) => {
println!("Raw payload: {}", payload);