Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/bin/rbw/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1948,6 +1948,10 @@ pub fn purge() -> anyhow::Result<()> {
Ok(())
}

pub fn ssh_agent_socket() {
println!("{}", rbw::dirs::ssh_agent_socket_file().display());
}

pub fn stop_agent() -> anyhow::Result<()> {
crate::actions::quit()?;

Expand Down
11 changes: 11 additions & 0 deletions src/bin/rbw/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ enum Opt {
#[command(about = "Remove the local copy of the password database")]
Purge,

#[command(
name = "ssh-agent-socket",
about = "Print the path to the SSH agent socket"
)]
SshAgentSocket,

#[command(name = "stop-agent", about = "Terminate the background agent")]
StopAgent,

Expand Down Expand Up @@ -261,6 +267,7 @@ impl Opt {
Self::History { .. } => "history".to_string(),
Self::Lock => "lock".to_string(),
Self::Purge => "purge".to_string(),
Self::SshAgentSocket => "ssh-agent-socket".to_string(),
Self::StopAgent => "stop-agent".to_string(),
Self::GenCompletions { .. } => "gen-completions".to_string(),
}
Expand Down Expand Up @@ -448,6 +455,10 @@ fn main() {
find_args.folder.as_deref(),
find_args.ignorecase,
),
Opt::SshAgentSocket => {
commands::ssh_agent_socket();
Ok(())
}
Opt::Lock => commands::lock(),
Opt::Purge => commands::purge(),
Opt::StopAgent => commands::stop_agent(),
Expand Down
Loading