diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-07-02 07:46:28 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-07-02 07:46:28 +0100 |
| commit | 9ba3dc08e60906cef6c82a375d3c427d2b2f4733 (patch) | |
| tree | c2cdd9c2597ac1908f32d413bfb5f36eb3423dcb /nostr_git_remote_helper/src | |
| parent | cc1cc62d8bd79920249f0738c20d5546f5363f28 (diff) | |
refactor: remove old remote helper placeholder
to make room for new one
Diffstat (limited to 'nostr_git_remote_helper/src')
| -rw-r--r-- | nostr_git_remote_helper/src/main.rs | 39 | ||||
| -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 | 2 | ||||
| -rw-r--r-- | nostr_git_remote_helper/src/sub_commands/placeholder.rs | 10 |
4 files changed, 0 insertions, 59 deletions
diff --git a/nostr_git_remote_helper/src/main.rs b/nostr_git_remote_helper/src/main.rs deleted file mode 100644 index 849396c..0000000 --- a/nostr_git_remote_helper/src/main.rs +++ /dev/null | |||
| @@ -1,39 +0,0 @@ | |||
| 1 | #![cfg_attr(not(test), warn(clippy::pedantic))] | ||
| 2 | #![cfg_attr(not(test), warn(clippy::expect_used))] | ||
| 3 | |||
| 4 | use anyhow::Result; | ||
| 5 | use clap::{Parser, Subcommand}; | ||
| 6 | |||
| 7 | mod sub_commands; | ||
| 8 | |||
| 9 | #[derive(Parser)] | ||
| 10 | #[command(author, version, about, long_about = None)] | ||
| 11 | #[command(propagate_version = true)] | ||
| 12 | pub struct Cli { | ||
| 13 | #[command(subcommand)] | ||
| 14 | command: Commands, | ||
| 15 | } | ||
| 16 | |||
| 17 | #[derive(Subcommand)] | ||
| 18 | enum Commands { | ||
| 19 | /// replace with an actual subcommand | ||
| 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 | ||
| 28 | } | ||
| 29 | |||
| 30 | #[tokio::main] | ||
| 31 | async fn main() -> Result<()> { | ||
| 32 | let cli = Cli::parse(); | ||
| 33 | match &cli.command { | ||
| 34 | Commands::Capabilities() => sub_commands::capabilities::launch(), | ||
| 35 | Commands::Placeholder(args) => { | ||
| 36 | sub_commands::placeholder::launch(&cli, args).await | ||
| 37 | } | ||
| 38 | } | ||
| 39 | } | ||
diff --git a/nostr_git_remote_helper/src/sub_commands/capabilities.rs b/nostr_git_remote_helper/src/sub_commands/capabilities.rs deleted file mode 100644 index 325cb3b..0000000 --- a/nostr_git_remote_helper/src/sub_commands/capabilities.rs +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 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 deleted file mode 100644 index c60ab7a..0000000 --- a/nostr_git_remote_helper/src/sub_commands/mod.rs +++ /dev/null | |||
| @@ -1,2 +0,0 @@ | |||
| 1 | pub mod capabilities; | ||
| 2 | pub mod placeholder; | ||
diff --git a/nostr_git_remote_helper/src/sub_commands/placeholder.rs b/nostr_git_remote_helper/src/sub_commands/placeholder.rs deleted file mode 100644 index ebe05ff..0000000 --- a/nostr_git_remote_helper/src/sub_commands/placeholder.rs +++ /dev/null | |||
| @@ -1,10 +0,0 @@ | |||
| 1 | use anyhow::Result; | ||
| 2 | |||
| 3 | use crate::Cli; | ||
| 4 | |||
| 5 | #[derive(Debug, clap::Args)] | ||
| 6 | pub struct SubCommandArgs {} | ||
| 7 | |||
| 8 | pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | ||
| 9 | Ok(()) | ||
| 10 | } | ||