feat(cli): line mode option support #1822
Merged
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.
PR Checklist
What is the current behavior?
To read messages from stdin line by line, users need to use two separate options:
-s
and-M
. This combination is not intuitive and requires users to remember to use both options together.Example of current usage:
mqttx pub -t "topic" -s -M
What is the new behavior?
Added a new convenient option
-lm, --line-mode
that combines the functionality of-s
and-M
. This makes the command more intuitive and easier to use.New usage:
The old way (
-s -M
) still works for backward compatibility, but the new option provides a more straightforward approach.Does this PR introduce a breaking change?
Specific Instructions
-lm
option is equivalent to using-s -M
together-s -M
will continue to work as before