wallet_lib/
command.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

// #[derive(Clone, Copy)]
#[derive(Debug)]
pub struct CommandOptions {
    wallet_path: String,
}

impl CommandOptions {
    pub fn new() -> Self {
        CommandOptions {
            wallet_path: String::new(),
        }
    }

    fn wallet_path(&self) -> String {
        println!("-> CommandOptions::wallet_path()");

        // self.wallet_path.clone()
        String::new() // TODO
    }
}

trait Command {
    fn exec(&self);
}

struct AddCommand {
    options: CommandOptions,
}

impl Command for AddCommand {
    fn exec(&self) {
        println!("-> AddCommand::exec()");

        // let _wallet = Wallet::new_with_path(self.options.wallet_path());
        // let _entry = Entry::new();

        // _wallet.add(_entry);
    }
}