diff options
Diffstat (limited to 'src/bin/zot')
-rw-r--r-- | src/bin/zot/main.rs | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/src/bin/zot/main.rs b/src/bin/zot/main.rs index 7f49eb4..63b4557 100644 --- a/src/bin/zot/main.rs +++ b/src/bin/zot/main.rs @@ -36,13 +36,22 @@ async fn main() -> Result<(), Box<(dyn std::error::Error + 'static)>> { (@arg channel: --channel "The channel to connect as.") (@arg password: --password "The password.") (@subcommand verify => - (about: "Verify") + (about: "Fetch the channel object of the logged in channel.") ) (@subcommand version => (about: "Return the version of a server.") ) (@subcommand channel => - (about: "Fetch the channel stream") + (about: "Work with channels") + (@subcommand list => + (about: "List channels for the logged in account.") + ) + (@subcommand stream => + (about: "Fetch the channel stream.") + ) + (@subcommand export => + (about: "Export the channel.") + ) ) (@subcommand network => (about: "Fetch the network stream") @@ -97,11 +106,27 @@ async fn main() -> Result<(), Box<(dyn std::error::Error + 'static)>> { ("version", Some(_)) => { println!("{}", z.version().await?); } - /* + ("channel", Some(m)) => { - let raw = m.is_present("raw"); - zot::channel_stream::fetch(&client, raw).await; + match m.subcommand() { + ("list", Some(_)) => { + for ch in z.channel_list().await? { + println!("{}", ch); + } + } + ("stream", Some(_)) => { + println!("{}", z.channel_stream().await?); + } + ("export", Some(_)) => { + println!("{}", z.channel_export().await?); + } + _ => { + println!("Not a known subcommand for `channel`, or it's not implemented yet."); + println!("{}", m.usage()); + } + } } + /* ("network", Some(m)) => { let raw = m.is_present("raw"); zot::network_stream::fetch(&client, raw).await; |