Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): line mode option support #1822

Merged
merged 1 commit into from
Dec 4, 2024
Merged

feat(cli): line mode option support #1822

merged 1 commit into from
Dec 4, 2024

Conversation

ysfscream
Copy link
Member

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:

❯ mqttx pub -t test -lm
✔ Connected, input and press Enter to publish
- Press Ctrl+C to disconnect and exit
test

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?

  • Yes
  • No

Specific Instructions

  1. The new -lm option is equivalent to using -s -M together
  2. Existing code using -s -M will continue to work as before

@ysfscream ysfscream added enhancement New feature or request CLI MQTTX CLI labels Dec 4, 2024
@ysfscream ysfscream added this to the v1.11.1 milestone Dec 4, 2024
@ysfscream ysfscream requested a review from Red-Asuka December 4, 2024 02:14
@ysfscream ysfscream self-assigned this Dec 4, 2024
@Red-Asuka Red-Asuka merged commit 4039ead into main Dec 4, 2024
6 checks passed
@Red-Asuka Red-Asuka deleted the ysf/cli branch December 4, 2024 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI MQTTX CLI enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants