-
Notifications
You must be signed in to change notification settings - Fork 462
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): bench pub support split file content #1642
Conversation
@@ -501,6 +501,7 @@ export class Commander { | |||
'load the parameters from the local configuration file, which supports json and yaml format, default path is ./mqttx-cli-config.json', | |||
) | |||
.option('--file-read <PATH>', 'read the message body from the file', parseFileRead) | |||
.option('--split <CHARACTER>', 'split the input message in a single file by a specified character.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should set \n
as the default value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I thought so at first, but I didn't finish.
@@ -114,6 +114,7 @@ declare global { | |||
messageInterval: number | |||
limit: number | |||
verbose: boolean | |||
split: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an optional option, which may be undefined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but the limit, verbose, and others are optional, too, right? Was there no impact before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value of limit is 0
, and verbose is a boolean type option. The default behavior is false, so it has no effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we need to set a default value for the split option as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be similar to the save and config options. If the option is not declared, it will be undefined. If the option is declared but no value is set, it will default to a default value.
PR Checklist
If you have any questions, you can refer to the Contributing Guide
What is the current behavior?
Please describe the current behavior and link to a relevant issue.
Issue Number
Example: #123
What is the new behavior?
Please describe the new behavior or provide screenshots.
Does this PR introduce a breaking change?
Specific Instructions
Are there any specific instructions or things that should be known prior to review?
Other information