feat: Add --exclude option for host exclusion (pdsh -x compatibility)#100
Merged
feat: Add --exclude option for host exclusion (pdsh -x compatibility)#100
Conversation
Add a new --exclude option to bssh that allows users to exclude specific hosts from the target list. This is part of pdsh compatibility mode (Phase 1 of #91). Features: - --exclude option accepts comma-separated list of hosts to exclude - Supports wildcard patterns using glob matching (e.g., 'db*', '*-backup') - Works with both -H (direct hosts) and -C (cluster) modes - Applied after --filter option for precise control - Comprehensive error handling for excluding all hosts Note: Short option -x is not used due to conflict with existing --no-x11 option. The -x short form will be available in pdsh compatibility mode. Closes #93
- Add tests for bracket pattern matching (e.g., [12], [!12]) - Add tests for bracket negation patterns - Update help text to document matching behavior differences - Fix misleading comment about ReDoS protection - Allow '!' character in patterns for negation support
- Add --exclude examples in README.md Multi-Server Mode section - Add --exclude to Command-Line Options in README.md - Add --exclude option documentation to manpage with examples - Update ARCHITECTURE.md with current nodes.rs line count
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a new
--excludeoption to bssh that allows users to exclude specific hosts from the target list. This is part of pdsh compatibility mode (Phase 1 of #91).Changes
CLI Option
--excludeoption with comma-separated value supportdb*,*-backup)--filteroption for precise controlUsage Examples
Implementation Details
exclude_nodes()function insrc/app/nodes.rsNote
Short option
-xis not used due to conflict with existing--no-x11option. The-xshort form will be available in pdsh compatibility mode.Test Plan
Closes #93