diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2023-12-01 00:00:00 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2023-12-01 00:00:00 +0000 |
| commit | 492cc67887855cecb3fb501c4b61af50bf645b73 (patch) | |
| tree | 200f0941f596a8703b39384bafa0d22526459189 /nostr_git_remote_helper/src | |
| parent | 1ec8b9be91ab2d172ad97cd6f402ff23cfca30f9 (diff) | |
feat(helper) add capabilities cmd
as specified in https://git-scm.com/docs/gitremote-helpers
Diffstat (limited to 'nostr_git_remote_helper/src')
| -rw-r--r-- | nostr_git_remote_helper/src/main.rs | 8 | ||||
| -rw-r--r-- | nostr_git_remote_helper/src/sub_commands/capabilities.rs | 8 | ||||
| -rw-r--r-- | nostr_git_remote_helper/src/sub_commands/mod.rs | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/nostr_git_remote_helper/src/main.rs b/nostr_git_remote_helper/src/main.rs index 05e3fab..898f069 100644 --- a/nostr_git_remote_helper/src/main.rs +++ b/nostr_git_remote_helper/src/main.rs | |||
| @@ -18,12 +18,20 @@ pub struct Cli { | |||
| 18 | enum Commands { | 18 | enum Commands { |
| 19 | /// replace with an actual subcommand | 19 | /// replace with an actual subcommand |
| 20 | Placeholder(sub_commands::placeholder::SubCommandArgs), | 20 | Placeholder(sub_commands::placeholder::SubCommandArgs), |
| 21 | Capabilities(), | ||
| 22 | // list | ||
| 23 | // - get git list from remote git server | ||
| 24 | // - suppliment list with open prs and send back | ||
| 25 | // - get prs | ||
| 26 | // - get commits against pr | ||
| 27 | // - find most recent commit against pr | ||
| 21 | } | 28 | } |
| 22 | 29 | ||
| 23 | #[tokio::main] | 30 | #[tokio::main] |
| 24 | async fn main() -> Result<()> { | 31 | async fn main() -> Result<()> { |
| 25 | let cli = Cli::parse(); | 32 | let cli = Cli::parse(); |
| 26 | match &cli.command { | 33 | match &cli.command { |
| 34 | Commands::Capabilities() => sub_commands::capabilities::launch(), | ||
| 27 | Commands::Placeholder(args) => { | 35 | Commands::Placeholder(args) => { |
| 28 | futures::executor::block_on(sub_commands::placeholder::launch(&cli, args)) | 36 | futures::executor::block_on(sub_commands::placeholder::launch(&cli, args)) |
| 29 | } | 37 | } |
diff --git a/nostr_git_remote_helper/src/sub_commands/capabilities.rs b/nostr_git_remote_helper/src/sub_commands/capabilities.rs new file mode 100644 index 0000000..325cb3b --- /dev/null +++ b/nostr_git_remote_helper/src/sub_commands/capabilities.rs | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | use anyhow::Result; | ||
| 2 | |||
| 3 | // https://git-scm.com/docs/gitremote-helpers#_capabilities | ||
| 4 | pub async fn launch() -> Result<()> { | ||
| 5 | // blank line indicates end of capabilities | ||
| 6 | println(""); | ||
| 7 | Ok(()) | ||
| 8 | } | ||
diff --git a/nostr_git_remote_helper/src/sub_commands/mod.rs b/nostr_git_remote_helper/src/sub_commands/mod.rs index b12a94a..c60ab7a 100644 --- a/nostr_git_remote_helper/src/sub_commands/mod.rs +++ b/nostr_git_remote_helper/src/sub_commands/mod.rs | |||
| @@ -1 +1,2 @@ | |||
| 1 | pub mod capabilities; | ||
| 1 | pub mod placeholder; | 2 | pub mod placeholder; |