mirror of
https://codeberg.org/Cyborus/forgejo-cli.git
synced 2024-11-10 12:09:33 +01:00
chore: user.rs
file
This commit is contained in:
parent
ebcc8b8226
commit
839a63bb39
2 changed files with 26 additions and 0 deletions
|
@ -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
23
src/user.rs
Normal 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(())
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue