diff options
Diffstat (limited to 'src/sub_commands/pull.rs')
| -rw-r--r-- | src/sub_commands/pull.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/sub_commands/pull.rs b/src/sub_commands/pull.rs new file mode 100644 index 0000000..0030dbe --- /dev/null +++ b/src/sub_commands/pull.rs | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | |||
| 2 | |||
| 3 | use clap::Args; | ||
| 4 | use nostr::{Keys}; | ||
| 5 | |||
| 6 | use crate::{fetch_pull_push::fetch_pull_push}; | ||
| 7 | |||
| 8 | #[derive(Args)] | ||
| 9 | pub struct PullSubCommand { | ||
| 10 | /// branch nevent or hex to pull into a new local branch | ||
| 11 | #[arg(short, long)] | ||
| 12 | pub branch: Option<String>, | ||
| 13 | } | ||
| 14 | |||
| 15 | pub fn pull_from_relays(keys: Option<&Keys>, sub_command_args: &PullSubCommand) { | ||
| 16 | |||
| 17 | fetch_pull_push( | ||
| 18 | keys, | ||
| 19 | true, | ||
| 20 | false, | ||
| 21 | sub_command_args.branch.clone(), | ||
| 22 | false, | ||
| 23 | None, | ||
| 24 | None, | ||
| 25 | ); | ||
| 26 | } | ||