@@ -26,15 +26,16 @@ fn github_client_id() -> String {
2626pub struct ClaimCommand {
2727 #[ command( subcommand) ]
2828 pub platform : ClaimPlatform ,
29-
30- #[ arg( long, default_value = DEFAULT_REGISTRY_URL ) ]
31- pub registry : String ,
3229}
3330
3431#[ derive( Subcommand , Debug , Clone ) ]
3532pub enum ClaimPlatform {
3633 /// Link your GitHub account to your identity.
37- Github ,
34+ Github {
35+ /// Registry URL to publish the claim to.
36+ #[ arg( long, default_value = DEFAULT_REGISTRY_URL ) ]
37+ registry : String ,
38+ } ,
3839}
3940
4041pub fn handle_claim (
@@ -44,6 +45,10 @@ pub fn handle_claim(
4445 env_config : & EnvironmentConfig ,
4546 now : chrono:: DateTime < chrono:: Utc > ,
4647) -> Result < ( ) > {
48+ let registry_url = match & cmd. platform {
49+ ClaimPlatform :: Github { registry } => registry. clone ( ) ,
50+ } ;
51+
4752 let ctx = build_auths_context ( repo_path, env_config, Some ( passphrase_provider) )
4853 . context ( "Failed to build auths context" ) ?;
4954
@@ -53,7 +58,7 @@ pub fn handle_claim(
5358
5459 let config = GitHubClaimConfig {
5560 client_id : github_client_id ( ) ,
56- registry_url : cmd . registry . clone ( ) ,
61+ registry_url,
5762 scopes : "read:user gist" . to_string ( ) ,
5863 } ;
5964
0 commit comments