Summary
Add a new --exclude option to bssh that allows users to exclude specific hosts from the target list. This is a prerequisite for pdsh compatibility mode.
Parent Issue
Part of #91 (pdsh compatibility mode) - Phase 1: New Options for Feature Parity
Problem / Background
pdsh provides -x hosts option to exclude specific hosts from command execution. This is useful when you want to run commands on most hosts in a cluster but skip certain nodes (e.g., nodes under maintenance).
Proposed Solution
CLI Interface
# Exclude single host
bssh -H "node1,node2,node3" --exclude "node2" "uptime"
# Exclude multiple hosts
bssh -C production --exclude "web1,web2" "apt update"
# Exclude with pattern (optional enhancement)
bssh -C production --exclude "db*" "systemctl restart nginx"
Option Definition
#[arg(
short = 'x',
long = "exclude",
value_delimiter = ',',
help = "Exclude hosts from target list (comma-separated)\nSupports patterns with wildcards (e.g., 'db*')"
)]
pub exclude: Option<Vec<String>>,
Acceptance Criteria
Implementation Tasks
Technical Considerations
- Short option
-x may conflict with bssh's --no-x11 option (currently -x). Need to evaluate if -x should be reassigned.
- If
-x conflicts, use only --exclude long form for bssh native mode; -x will work in pdsh compatibility mode.
- Pattern matching can reuse existing
glob crate or implement simple fnmatch-style matching.
Additional Context
Summary
Add a new
--excludeoption to bssh that allows users to exclude specific hosts from the target list. This is a prerequisite for pdsh compatibility mode.Parent Issue
Part of #91 (pdsh compatibility mode) - Phase 1: New Options for Feature Parity
Problem / Background
pdsh provides
-x hostsoption to exclude specific hosts from command execution. This is useful when you want to run commands on most hosts in a cluster but skip certain nodes (e.g., nodes under maintenance).Proposed Solution
CLI Interface
Option Definition
Acceptance Criteria
--exclude "host1"removes host1 from target list--exclude "host1,host2"removes multiple hostsdb*,*-backup)-H(direct hosts) and-C(cluster) modesImplementation Tasks
--exclude/-xoption toClistruct insrc/cli.rsdb*,*-backup)Technical Considerations
-xmay conflict with bssh's--no-x11option (currently-x). Need to evaluate if-xshould be reassigned.-xconflicts, use only--excludelong form for bssh native mode;-xwill work in pdsh compatibility mode.globcrate or implement simple fnmatch-style matching.Additional Context
-xoption: https://linux.die.net/man/1/pdsh