anchor.diff:   *  -q quality of service. Default is 0
    *  -r message should be retained
    *  -u provide a username
  - *  -P provide a password
  - *  --will-payload payload for the client will
  - *  --will-qos  quality of service for the client will
  - *  --will-retain if provided, make the client will retain
  - *  --will-topic  the topic on which to publish the client will
  + *  -p provide a password
  + *  --willMessage payload for the client will
  + *  --willQos  quality of service for the client will
  + *  --willRetain if provided, make the client will retain
  + *  --willTopic the topic on which to publish the client will
    *  
    *  [ADD CERTICATE / ENCRYPTION support]
    *  
    */
   
   class MqttPubOptions {
  -  static Map<String, String> optionList = {
  -                        '-?': 'display help message',
  -                        '-d': 'enable debug message',
  -                        '-h': 'host to connect to. Default is 127.0.0.1',
  -                        '-p': 'port to connect to. Default is 1883',
  -                        '--url' : 'broker url for websocket connection',
  -                        '-c': 'client ID',
  -                        '-i': 'message ID',
  -                        '-t': 'topic',
  -                        '-m': 'message payload',
  -                        '-q': 'quality of service. Default is 0',
  -                        '-r': 'message should be retained',
  -                        '-u': 'provide a username',
  -                        '-P': 'provide a password',
  -                        '--will-payload': 'payload for the client will',
  -                        '--will-qos': 'quality of service for the client will',
  -                        '--will-retain': 'if provided, make the client will retain',
  -                        '--will-topic': 'the topic on which to publish the client will'};
  +
     
     bool debugMessage = false;
     String host = '127.0.0.1';
  
positive.code: void publish(MqttClient c, MqttPubOptions mqttOptions) {
    c.publish(mqttOptions.topic, mqttOptions.payload, mqttOptions.messageID, mqttOptions.QoS, mqttOptions.retain)
        .then( (m) {
          print("Message ${m.messageID} published");
          if (mqttOptions.willTopic == null) {    // if a WILL is defined, don't disconnect to have the will sent
            c.disconnect();
  
negative.code: }
  void onConnectionLost() {
    print("Connection lost");
  }
  