Skip to content

Commit

Permalink
cli: support parsing global flags from env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptonist committed Nov 10, 2022
1 parent 6eab99e commit cfd4fa3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"

[dependencies]
anyhow = "1.0.66"
clap = { version = "4.0.22", features = ["derive"] }
clap = { version = "4.0.22", features = ["derive", "env"] }
console = "0.15.2"
indicatif = "0.17.2"
reqwest = { version = "0.11.12", features = ["json", "rustls-tls"] }
Expand Down
4 changes: 2 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use clap::{Parser, Subcommand};
#[command(version = "0.1")]
#[command(about = "CLI plugin which allows to database entities in hasura")]
pub struct Cli {
#[arg(long)]
#[arg(long, env = "HASURA_GRAPHQL_ENDPOINT")]
pub endpoint: String,
#[arg(long)]
#[arg(long, env = "HASURA_GRAPHQL_ADMIN_SECRET")]
pub admin_secret: Option<String>,

#[command(subcommand)]
Expand Down

0 comments on commit cfd4fa3

Please sign in to comment.