aboutsummaryrefslogtreecommitdiff
path: root/src/cli.rs
diff options
context:
space:
mode:
authorsodiboo <git@sodi.boo>2024-05-26 23:57:34 +0200
committerIvan Molodetskikh <yalterz@gmail.com>2024-06-28 14:00:26 +0300
commitd180e60e0584e0c43682d7aca612c366f881dd85 (patch)
treee240f28df0053bc61c090f5d76a34e164d91467f /src/cli.rs
parent65addefd09acef059e1415e9ebdfcbb82f86d689 (diff)
downloadniri-d180e60e0584e0c43682d7aca612c366f881dd85.tar.gz
niri-d180e60e0584e0c43682d7aca612c366f881dd85.tar.bz2
niri-d180e60e0584e0c43682d7aca612c366f881dd85.zip
Implement support for `$NIRI_CONFIG` environment variable
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 52489ad0..4004a331 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -13,6 +13,9 @@ use crate::utils::version;
#[command(subcommand_help_heading = "Subcommands")]
pub struct Cli {
/// Path to config file (default: `$XDG_CONFIG_HOME/niri/config.kdl`).
+ ///
+ /// This can also be set with the `NIRI_CONFIG` environment variable. If both are set, the
+ /// command line argument takes precedence.
#[arg(short, long)]
pub config: Option<PathBuf>,
/// Import environment globally to systemd and D-Bus, run D-Bus services.
@@ -43,6 +46,9 @@ pub enum Sub {
/// Validate the config file.
Validate {
/// Path to config file (default: `$XDG_CONFIG_HOME/niri/config.kdl`).
+ ///
+ /// This can also be set with the `NIRI_CONFIG` environment variable. If both are set, the
+ /// command line argument takes precedence.
#[arg(short, long)]
config: Option<PathBuf>,
},