diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2023-05-21 11:27:04 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2023-05-21 11:27:04 +0000 |
| commit | 318e467b158b158cf9eb843318dc14141d1b8c54 (patch) | |
| tree | 46ec99fccfac487b1ff2dd29d3b01fb970fcb88d /src/sub_commands/pull.rs | |
| parent | 2ce71c5434fb7245aad4d070e08bbf6792d79b4d (diff) | |
main and remaining subcommands
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 | } | ||