summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/config.rs14
-rw-r--r--src/main.rs6
2 files changed, 15 insertions, 5 deletions
diff --git a/src/config.rs b/src/config.rs
index d961f50..f8160af 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -15,9 +15,15 @@ pub struct Config {
/// Add arbitrary directories
///
/// Directories added by this flag are still filtered and sorted based on supplied options.
- #[arg(long = "project", short = 'P')]
+ #[arg(short = 'P', long = "project")]
pub projects: Vec<PathBuf>,
+ /// Add any current tmux session's paths to output.
+ ///
+ /// Uses the tmux session's `session_path`.
+ #[arg(short = 'T', long = "sessions")]
+ pub tmux_sessions: bool,
+
#[command(flatten)]
pub verbosity: Verbosity,
}
@@ -65,9 +71,11 @@ pub struct Projects {
#[arg(long, short)]
pub git: bool,
- /// Add current tmux session directories.
+ /// Use existing tmux sessions for project timestamps
///
- /// Uses last attached time as the timestamp.
+ /// Note: This only used for sorting projects using `session_last_attached` (or
+ /// `session_created` if not yet attached). For adding existing tmux session's paths to the
+ /// ouput, see `-T|--sessions`.
#[arg(long, short)]
pub tmux: bool,
}
diff --git a/src/main.rs b/src/main.rs
index 383411b..78583c2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -19,8 +19,10 @@ fn main() -> Result<()> {
projects.extend(search);
}
- if let Ok(sessions) = Tmux::sessions() {
- projects.extend(sessions)
+ if config.tmux_sessions {
+ if let Ok(sessions) = Tmux::sessions() {
+ projects.extend(sessions)
+ }
}
Ok(projects.write(std::io::stdout())?)