1use clap::Subcommand;
2
3use crate::render::{CommandOutput, CommandResult};
4
5#[derive(Subcommand, Clone, Debug)]
6pub enum TemplateCommands {
7 #[command(name = "item")]
8 Item,
9 #[command(name = "item.field")]
10 ItemField,
11 #[command(name = "item.login")]
12 ItemLogin,
13 #[command(name = "item.login.uri")]
14 ItemLoginUri,
15 #[command(name = "item.card")]
16 ItemCard,
17 #[command(name = "item.identity")]
18 ItemIdentity,
19 #[command(name = "item.securenote")]
20 ItemSecureNote,
21 #[command(name = "folder")]
22 Folder,
23 #[command(name = "collection")]
24 Collection,
25 #[command(name = "item-collections")]
26 ItemCollections,
27 #[command(name = "org-collection")]
28 OrgCollection,
29 #[command(name = "send.text")]
30 SendText,
31 #[command(name = "send.file")]
32 SendFile,
33}
34
35impl TemplateCommands {
36 pub fn run(&self) -> CommandResult {
37 match self {
38 Self::Folder => {
39 #[derive(serde::Serialize)]
40 struct FolderTemplate {
41 name: String,
42 }
43
44 Ok(CommandOutput::Object(Box::new(FolderTemplate {
45 name: "Folder name".to_string(),
46 })))
47 }
48 _ => todo!(),
49 }
50 }
51}
52
53#[derive(clap::Args, Clone)]
54pub struct RestoreArgs {
55 pub object: RestoreObject,
57 pub id: String,
59}
60
61#[derive(clap::ValueEnum, Clone, Debug)]
62#[value(rename_all = "kebab-case")]
63pub enum RestoreObject {
64 Item,
65}