diff --git a/Cargo.toml b/Cargo.toml index c73893a..4ecc1db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2024" [dependencies] -clap = { version = "4.0.7", features = ["derive"] } +clap = { version = "4.0.7", features = ["derive", "env"] } reqwest = { version = "0.11.13", features = ["json"] } serde = { version = "1.0.152", features = ["derive"] } tokio = { version = "1.24.2", features = ["macros", "rt-multi-thread"] } diff --git a/src/cli.rs b/src/cli.rs index f49279f..a604f2a 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -3,10 +3,10 @@ use clap::{Parser, Subcommand}; #[derive(Debug, Parser)] #[command(version, about, long_about = None)] pub struct Args { - #[arg(short = 'o', long = "owner")] - pub repo_owner: Option, - #[arg(short = 'n', long = "repo_name")] - pub repo_name: Option, + #[arg(short = 'o', long = "owner", env = "GTTOOL_OWNER")] + pub owner: String, + #[arg(short = 'r', long = "repo")] + pub repo: Option, #[command(subcommand)] pub command: Commands,