(ctx: Context)
| 136 | } |
| 137 | |
| 138 | async fn logout(ctx: Context) -> anyhow::Result<()> { |
| 139 | if ctx.config.api_token.is_empty() { |
| 140 | println!("You're not logged in"); |
| 141 | return Ok(()); |
| 142 | } |
| 143 | |
| 144 | let mut new_config = ctx.config; |
| 145 | new_config.api_token = String::new(); |
| 146 | confy::store(APP_NAME, &new_config)?; |
| 147 | |
| 148 | println!("Removed your login details"); |
| 149 | Ok(()) |
| 150 | } |