Skip to content

Conversation

ysfscream
Copy link
Member

@ysfscream ysfscream commented Dec 4, 2024

PR Checklist

What is the current behavior?

Currently, when using the pipe mode with -s -M options in MQTTX CLI, there are several issues:

  1. The command requires using two separate options (-s -M) for line-by-line input
  2. The log output is too verbose, showing a message for each published line
  3. The pipeline mode detection is not indicated
  4. The code structure for handling stdin is not optimized

Current behavior:

❯ cat message.txt | mqttx pub -t test -s -M
✔ Connected, press Enter to publish, press Ctrl+C to exit
✖ Connection closed

Issue Number

N/A

What is the new behavior?

  1. Added a new convenient option, -lm, that combines -s -M functionality
  2. Optimized log output to show a summary instead of individual messages
  3. Improved code structure for better maintainability

New behavior:

cat message.txt | mqttx pub -t test -s -M
✔ Connected
❯ Publishing 3 messages...
✔ Successfully published 3 messages

Does this PR introduce a breaking change?

  • Yes
  • No

@ysfscream ysfscream added enhancement New feature or request fix Fix bug or issues CLI MQTTX CLI labels Dec 4, 2024
@ysfscream ysfscream requested a review from Red-Asuka December 4, 2024 03:40
@ysfscream ysfscream self-assigned this Dec 4, 2024
@ysfscream ysfscream added this to the v1.11.1 milestone Dec 4, 2024
@ysfscream ysfscream changed the title fix(cli): support pub muliti lines on pipeline fix(cli): support pub multiple lines on pipeline. Dec 4, 2024
@ysfscream ysfscream changed the title fix(cli): support pub multiple lines on pipeline. fix(cli): support pub multiple lines on pipeline Dec 4, 2024
@Red-Asuka Red-Asuka merged commit b8a116e into main Dec 5, 2024
6 checks passed
@Red-Asuka Red-Asuka deleted the ysf/cli branch December 5, 2024 02:43
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 fix Fix bug or issues
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants