FileSpewer.cpp 1.01 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//============================================================================
// Name        : FileSpewer.cpp
// Author      : Axel Auweter
// Version     :
// Copyright   : Leibniz Supercomputing Centre
// Description : Minimalistic tool to push file contents over MQTT
//============================================================================

#include <cstdio>
#include <cstdlib>

#include "Settings.h"

Settings* mySettings;

void usage() {
  printf("Usage: FileSpewer [-i <interval>] [-h <host>] <filename>\n\n");
  printf("FileSpewer will send the contents of <filename> every <interval> milliseconds\n");
  printf("to the broker <host>. The default value for <interval> is 1000 milliseconds and\n");
  printf("the default <host> is localhost.\n");
}

int main(int argc, const char* argv[]) {

  /* Check command line */
  mySettings = new Settings(argc, argv);

  switch(mySettings->getMode()) {
  case USAGE:
    usage();
    break;
  default:
    break;
  }

  /* Clean up */
  delete mySettings;

  return EXIT_SUCCESS;
}