chore: user.rs file

This commit is contained in:
Cyborus 2024-06-17 22:13:15 -04:00
parent ebcc8b8226
commit 839a63bb39
No known key found for this signature in database
2 changed files with 26 additions and 0 deletions

View file

@ -12,6 +12,7 @@ mod issues;
mod prs;
mod release;
mod repo;
mod user;
#[derive(Parser, Debug)]
pub struct App {
@ -37,6 +38,7 @@ pub enum Command {
#[clap(subcommand)]
Auth(auth::AuthCommand),
Release(release::ReleaseCommand),
User(user::UserCommand),
Version {
/// Checks for updates
#[clap(long)]
@ -76,6 +78,7 @@ async fn main() -> eyre::Result<()> {
}
Command::Auth(subcommand) => subcommand.run(&mut keys, host_name).await?,
Command::Release(subcommand) => subcommand.run(&mut keys, host_name).await?,
Command::User(subcommand) => subcommand.run(&mut keys, host_name).await?,
Command::Version {
#[cfg(feature = "update-check")]
check,

23
src/user.rs Normal file
View file

@ -0,0 +1,23 @@
use clap::{Args, Subcommand};
use crate::repo::RepoInfo;
#[derive(Args, Clone, Debug)]
pub struct UserCommand {
#[clap(long, short = 'R')]
remote: Option<String>,
#[clap(subcommand)]
command: UserSubcommand,
}
#[derive(Subcommand, Clone, Debug)]
pub enum UserSubcommand {}
impl UserCommand {
pub async fn run(self, keys: &mut crate::KeyInfo, host_name: Option<&str>) -> eyre::Result<()> {
let repo = RepoInfo::get_current(host_name, None, self.remote.as_deref())?;
let api = keys.get_api(repo.host_url()).await?;
match self.command {}
Ok(())
}
}