feat: Add --no-prefix option to disable hostname prefix in output (pdsh -N compatibility)#101
Merged
feat: Add --no-prefix option to disable hostname prefix in output (pdsh -N compatibility)#101
Conversation
…sh -N compatibility) Add a new --no-prefix / -N option that disables the hostname prefix in command output lines. This is useful for programmatic parsing or cleaner display, and provides compatibility with pdsh's -N option. Changes: - Add --no-prefix / -N option to CLI struct in src/cli.rs - Add no_prefix field to ExecuteCommandParams - Modify OutputMode to track no_prefix setting for Stream and File modes - Update NodeOutputWriter to conditionally format output with/without prefix - Thread no_prefix option through ParallelExecutor streaming handlers - Add unit tests for no_prefix functionality Closes #92
- Add CLI parsing tests for --no-prefix/-N option (10 test cases) - Update README.md with --no-prefix in Command-Line Options section - Update README.md Stream Mode section with --no-prefix usage example - Update manpage (bssh.1) with --no-prefix/-N option documentation Tests cover: - Long and short option parsing - Default value (false) - Combination with --stream mode - Combination with --output-dir mode - Combination with cluster option - Combination with other CLI options - OutputMode is_no_prefix() behavior for all modes
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
--no-prefix/-Noption that disables hostname prefix in output lines-Nflag--stream) and file output mode (--output-dir)Changes
Implementation
--no-prefix/-Noption to CLI struct insrc/cli.rsno_prefixfield toExecuteCommandParamsOutputModeto trackno_prefixsetting forStreamandFilemodesNodeOutputWriterto conditionally format output with/without prefixno_prefixoption throughParallelExecutorstreaming handlersTests
no_prefixfunctionality inoutput_sync.rsandoutput_mode.rs--no-prefix/-Noption (10 test cases) intests/no_prefix_test.rsDocumentation
--no-prefixin Command-Line Options section--no-prefixusage example--no-prefix/-Noption documentationUsage
Test plan
no_prefixfunctionality--helpshows the new option correctlyCloses #92