Skip to content

Commit

Permalink
Publish > Add documentation for m:empty option
Browse files Browse the repository at this point in the history
  • Loading branch information
gitseti committed Oct 5, 2022
1 parent 0665322 commit 9c6f87a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/_docs/publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ mqtt pub --help

```
mqtt pub -t <topics> [-t <topics>]...
(-m <message> | -m:file <filename>)
(-m <message> | -m:file <filename> | -m:empty)
[-cdrsvl]
[-q <qos>]...
[-e <messageExpiryInterval>]
Expand Down Expand Up @@ -91,6 +91,7 @@ mqtt pub -t <topics> [-t <topics>]...
| ``-t`` | ``--topic`` | The MQTT topic to which the message will be published. |
| ``-m`` | ``--message`` | The message which will be published on the topic. |
| ``-m:file`` | ``--message-file`` | The file whose payload will be published on the topic. |
| ``-m:empty`` | ``--message-empty`` | Sets the message to an empty payload. |
| ``-r`` | ``--[no-]retain`` | Whether the message will be retained. | ``False``
| ``-q`` | ``--qos`` | Define the quality of service level. If only one QoS is specified it will be used for all topics.<br> You can define a specific QoS level for every topic. The corresponding QoS levels will be matched in order to the given topics. | ``0``
| ``-e`` | ``--messageExpiryInterval`` | The lifetime of the publish message in seconds. |
Expand Down
3 changes: 2 additions & 1 deletion docs/_docs/shell/publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Instead it uses the currently active context client.

```
client@host> pub -t <topics> [-t <topics>]...
(-m <message> | -m:file <filename>)
(-m <message> | -m:file <filename> | -m:empty)
[-q <qos>]...
[-r]
[-e <messageExpiryInterval>]
Expand All @@ -34,6 +34,7 @@ client@host> pub -t <topics> [-t <topics>]...
| ``-t`` | ``--topic``| The MQTT topic where the message will be published. |
| ``-m``| ``--message`` | The message which will be published on the topic. |
| ``-m:file`` | ``--message-file`` | The file whose payload will be published on the topic. |
| ``-m:empty`` | ``--message-empty`` | Sets the message to an empty payload. |
| ``-q`` | ``--qos`` | Use a defined quality of service level on all topics if only one QoS is specified.<br> You can define a specific QoS level for every topic. The corresponding QoS levels will be matched in order to the given topics. | ``0``
| ``-r``| ``--[no-]retain`` | Message will be retained. | ``False``
| ``-e`` | ``--messageExpiryInterval`` | The lifetime of the publish message in seconds. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private void setMessageFromCommandline(final @NotNull ByteBuffer messageFromFile
}

@SuppressWarnings("unused")
@CommandLine.Option(names = {"-m:empty", "--message-empty"}, defaultValue = "false",description = "Sets the message to an empty payload")
@CommandLine.Option(names = {"-m:empty", "--message-empty"}, defaultValue = "false", description = "Sets the message to an empty payload")
private void setMessageToEmpty(final boolean isEmpty) {
if (isEmpty) {
messageBuffer = ByteBuffer.allocate(0);
Expand Down

0 comments on commit 9c6f87a

Please sign in to comment.