summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2023-05-08 16:38:40 -0500
committerToby Vincent <tobyv13@gmail.com>2023-05-08 16:38:40 -0500
commited67fa7a39ca5f4c77377a6ada9d1900b1dbfd90 (patch)
tree660b065fd77b995855eb10be0acc89d789355b61 /src/main.rs
parent1bf5fc03411b8544c18066675984d3c99a5c9e65 (diff)
feat: add flag to exclude attached tmux session
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 25a051e..a50d3a1 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -3,7 +3,7 @@ use clap::Parser;
use projectr::{config::Config, project::Projects, tmux::Tmux, Search};
fn main() -> Result<()> {
- let config = Config::parse();
+ let mut config = Config::parse();
tracing_subscriber::fmt::fmt()
.pretty()
@@ -11,6 +11,12 @@ fn main() -> Result<()> {
.with_max_level(&config.verbosity)
.init();
+ if config.exclude_attached {
+ if let Ok(path) = Tmux::attached() {
+ config.parsers.excludes.push(path)
+ }
+ }
+
let mut projects = Projects::from(config.parsers);
projects.extend(config.include);