diff options
Diffstat (limited to 'src/sub_commands/claim.rs')
| -rw-r--r-- | src/sub_commands/claim.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sub_commands/claim.rs b/src/sub_commands/claim.rs index ce39a64..05ad961 100644 --- a/src/sub_commands/claim.rs +++ b/src/sub_commands/claim.rs | |||
| @@ -23,6 +23,9 @@ pub struct SubCommandArgs { | |||
| 23 | /// optional description | 23 | /// optional description |
| 24 | description: Option<String>, | 24 | description: Option<String>, |
| 25 | #[clap(short, long, value_parser, num_args = 1..)] | 25 | #[clap(short, long, value_parser, num_args = 1..)] |
| 26 | /// homepage | ||
| 27 | web: Vec<String>, | ||
| 28 | #[clap(short, long, value_parser, num_args = 1..)] | ||
| 26 | /// relays contributors push patches and comments to | 29 | /// relays contributors push patches and comments to |
| 27 | relays: Vec<String>, | 30 | relays: Vec<String>, |
| 28 | } | 31 | } |
| @@ -62,6 +65,15 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 62 | ) | 65 | ) |
| 63 | .context("no git remote origin configured")?; | 66 | .context("no git remote origin configured")?; |
| 64 | 67 | ||
| 68 | let web: Vec<String> = if args.web.is_empty() { | ||
| 69 | Interactor::default() | ||
| 70 | .input(PromptInputParms::default().with_prompt("description (Optional)"))? | ||
| 71 | .split(' ') | ||
| 72 | .map(std::string::ToString::to_string) | ||
| 73 | .collect() | ||
| 74 | } else { | ||
| 75 | args.web.clone() | ||
| 76 | }; | ||
| 65 | #[cfg(not(test))] | 77 | #[cfg(not(test))] |
| 66 | let mut client = Client::default(); | 78 | let mut client = Client::default(); |
| 67 | #[cfg(test)] | 79 | #[cfg(test)] |
| @@ -120,10 +132,12 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 120 | println!("publishing repostory reference..."); | 132 | println!("publishing repostory reference..."); |
| 121 | 133 | ||
| 122 | let repo_event = RepoRef { | 134 | let repo_event = RepoRef { |
| 135 | identifier: root_commit.to_string()[..7].to_string(), | ||
| 123 | name, | 136 | name, |
| 124 | description, | 137 | description, |
| 125 | root_commit: root_commit.to_string(), | 138 | root_commit: root_commit.to_string(), |
| 126 | git_server, | 139 | git_server, |
| 140 | web, | ||
| 127 | relays: repo_relays.clone(), | 141 | relays: repo_relays.clone(), |
| 128 | maintainers, | 142 | maintainers, |
| 129 | } | 143 | } |