aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2024-10-30 20:31:03 +0100
committerHarald Eilertsen <haraldei@anduin.net>2024-10-30 20:31:03 +0100
commit7787ae6fe68c7eb803363612244809e074d4fa45 (patch)
tree82db8736131d30992f69ffc27e01d21f6182921b
parent0f32f1d37c95818bc4ced69f09befe9320026611 (diff)
downloadrust-zotapi-7787ae6fe68c7eb803363612244809e074d4fa45.tar.gz
rust-zotapi-7787ae6fe68c7eb803363612244809e074d4fa45.tar.bz2
rust-zotapi-7787ae6fe68c7eb803363612244809e074d4fa45.zip
Re-export the structs from internal modules in the command mod.refactor-cmd-handling
Just improves usability some.
-rw-r--r--src/bin/zot/command.rs13
-rw-r--r--src/bin/zot/main.rs12
2 files changed, 19 insertions, 6 deletions
diff --git a/src/bin/zot/command.rs b/src/bin/zot/command.rs
index 6d85ed2..5f92752 100644
--- a/src/bin/zot/command.rs
+++ b/src/bin/zot/command.rs
@@ -9,3 +9,16 @@ pub mod channel;
pub mod contact;
pub mod verify;
pub mod version;
+
+pub use channel::{
+ export::ChannelExportCmd,
+ list::ChannelListCmd,
+ stream::ChannelStreamCmd,
+};
+
+pub use contact:: {
+ list::ContactListCmd,
+};
+
+pub use verify::VerifyCmd;
+pub use version::VersionCmd;
diff --git a/src/bin/zot/main.rs b/src/bin/zot/main.rs
index 8508c13..8cb3622 100644
--- a/src/bin/zot/main.rs
+++ b/src/bin/zot/main.rs
@@ -104,27 +104,27 @@ async fn main() -> Result<(), Box<(dyn std::error::Error + 'static)>> {
Ok(match matches.subcommand() {
("verify", Some(_)) => {
- let cmd = command::verify::VerifyCmd{};
+ let cmd = command::VerifyCmd{};
cmd.run(z).await?;
}
("version", Some(_)) => {
- let cmd = command::version::VersionCmd{};
+ let cmd = command::VersionCmd{};
cmd.run(z).await?;
}
("channel", Some(m)) => {
match m.subcommand() {
("list", Some(_)) => {
- let cmd = command::channel::list::ChannelListCmd{};
+ let cmd = command::ChannelListCmd{};
cmd.run(z).await?;
}
("stream", Some(_)) => {
- let cmd = command::channel::stream::ChannelStreamCmd{};
+ let cmd = command::ChannelStreamCmd{};
cmd.run(z).await?;
}
("export", Some(_)) => {
- let cmd = command::channel::export::ChannelExportCmd{};
+ let cmd = command::ChannelExportCmd{};
cmd.run(z).await?;
}
_ => {
@@ -136,7 +136,7 @@ async fn main() -> Result<(), Box<(dyn std::error::Error + 'static)>> {
("contact", Some(m)) => {
match m.subcommand() {
("list", Some(_)) => {
- let cmd = command::contact::list::ContactListCmd{};
+ let cmd = command::ContactListCmd{};
cmd.run(z).await?;
}
_ => {