mirror of
https://github.com/damus-io/notedeck.git
synced 2024-09-16 11:53:30 +00:00
cli: add --pub support for watchonly accounts
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
parent
dd60d03407
commit
11ede2086f
19
src/app.rs
19
src/app.rs
@ -560,8 +560,23 @@ impl Args {
|
||||
res.light = true;
|
||||
} else if arg == "--dark" {
|
||||
res.light = false;
|
||||
} else if arg == "--pub" || arg == "npub" {
|
||||
// TODO: npub watch-only accounts
|
||||
} else if arg == "--pub" || arg == "--npub" {
|
||||
i += 1;
|
||||
let pubstr = if let Some(next_arg) = args.get(i) {
|
||||
next_arg
|
||||
} else {
|
||||
error!("sec argument missing?");
|
||||
continue;
|
||||
};
|
||||
|
||||
if let Ok(pk) = Pubkey::parse(pubstr) {
|
||||
res.keys.push(Keypair::only_pubkey(pk));
|
||||
} else {
|
||||
error!(
|
||||
"failed to parse {} argument. Make sure to use hex or npub.",
|
||||
arg
|
||||
);
|
||||
}
|
||||
} else if arg == "--sec" || arg == "--nsec" {
|
||||
i += 1;
|
||||
let secstr = if let Some(next_arg) = args.get(i) {
|
||||
|
Loading…
Reference in New Issue
Block a user