aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/zot/command/version.rs
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2024-10-30 20:23:56 +0100
committerHarald Eilertsen <haraldei@anduin.net>2024-10-30 20:23:56 +0100
commit0f32f1d37c95818bc4ced69f09befe9320026611 (patch)
tree4cabd6fdfafff2aa245ed52a2adbcd824a9ed50f /src/bin/zot/command/version.rs
parent7daf82cb395e3612736eebae3fe699dae6d790b1 (diff)
downloadrust-zotapi-0f32f1d37c95818bc4ced69f09befe9320026611.tar.gz
rust-zotapi-0f32f1d37c95818bc4ced69f09befe9320026611.tar.bz2
rust-zotapi-0f32f1d37c95818bc4ced69f09befe9320026611.zip
Add command module and move implementations to it.
Diffstat (limited to 'src/bin/zot/command/version.rs')
-rw-r--r--src/bin/zot/command/version.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/bin/zot/command/version.rs b/src/bin/zot/command/version.rs
new file mode 100644
index 0000000..a184247
--- /dev/null
+++ b/src/bin/zot/command/version.rs
@@ -0,0 +1,19 @@
+/*
+ * SPDX-FileCopyrightText: 2024 Eilertsens Kodeknekkeri
+ * SPDX-FileCopyrightText: 2024 Harald Eilertsen
+ *
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+use std::error::Error;
+use zotapi::ZotApi;
+
+pub struct VersionCmd {
+}
+
+impl VersionCmd {
+ pub async fn run(&self, client: ZotApi) -> Result<(), Box<dyn Error + 'static>> {
+ println!("{}", client.version().await?);
+ Ok(())
+ }
+}