Demo: missing CLI args can be filled via env vars
This commit is contained in:
@@ -4,7 +4,7 @@ version = "0.1.0"
|
|||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "4.0.7", features = ["derive"] }
|
clap = { version = "4.0.7", features = ["derive", "env"] }
|
||||||
reqwest = { version = "0.11.13", features = ["json"] }
|
reqwest = { version = "0.11.13", features = ["json"] }
|
||||||
serde = { version = "1.0.152", features = ["derive"] }
|
serde = { version = "1.0.152", features = ["derive"] }
|
||||||
tokio = { version = "1.24.2", features = ["macros", "rt-multi-thread"] }
|
tokio = { version = "1.24.2", features = ["macros", "rt-multi-thread"] }
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ use clap::{Parser, Subcommand};
|
|||||||
#[derive(Debug, Parser)]
|
#[derive(Debug, Parser)]
|
||||||
#[command(version, about, long_about = None)]
|
#[command(version, about, long_about = None)]
|
||||||
pub struct Args {
|
pub struct Args {
|
||||||
#[arg(short = 'o', long = "owner")]
|
#[arg(short = 'o', long = "owner", env = "GTTOOL_OWNER")]
|
||||||
pub repo_owner: Option<String>,
|
pub owner: String,
|
||||||
#[arg(short = 'n', long = "repo_name")]
|
#[arg(short = 'r', long = "repo")]
|
||||||
pub repo_name: Option<String>,
|
pub repo: Option<String>,
|
||||||
|
|
||||||
#[command(subcommand)]
|
#[command(subcommand)]
|
||||||
pub command: Commands,
|
pub command: Commands,
|
||||||
|
|||||||
Reference in New Issue
Block a user