Skip to content

Commit

Permalink
Merge pull request #427 from razvanazamfirei/env-variable-support
Browse files Browse the repository at this point in the history
  • Loading branch information
panekj authored Jul 16, 2023
2 parents 794f6a2 + 442f7b7 commit 55c393e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/taplo-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ toml-test = []
[dependencies]
anyhow = { version = "1", features = ["backtrace"] }
async-ctrlc = { version = "1.2.0", features = ["stream"], optional = true }
clap = { version = "3.0.0", features = ["derive", "cargo"] }
clap = { version = "3.0.0", features = ["derive", "cargo", "env"] }
codespan-reporting = "0.11.1"
futures = "0.3"
glob = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion crates/taplo-cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct TaploArgs {
#[derive(Clone, Args)]
pub struct GeneralArgs {
/// Path to the Taplo configuration file.
#[clap(long, short)]
#[clap(long, short, env = "TAPLO_CONFIG")]
pub config: Option<PathBuf>,

/// Set a cache path.
Expand Down
2 changes: 1 addition & 1 deletion site/site/cli/usage/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ The available log levels:

<!-- TODO: config link -->

Taplo CLI by default searches for a Taplo config file in the current working directory, this behaviour can be disabled by either supplying `--no-auto-config` or `--config <path>` flags.
Taplo CLI, by default, searches the current working directory for a Taplo configuration file. This behaviour can be disabled by either supplying `--no-auto-config` or `--config <path>` flags. The `TAPLO_CONFIG` environmental variable can also be used to set the configuration, but the `--config` flag will take precedence.

0 comments on commit 55c393e

Please sign in to comment.