summaryrefslogtreecommitdiff
path: root/src/bin/main.c
blob: 0e739ff1592dcfbe1a1ecc461eda69153345c5b4 (plain) (blame)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
 * Copyright © 2013 Guillaume Friloux <kuri@efl.so>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include "smman.h"

void _usage(char *progname)
{
   printf("  _______                                   \n");
   printf(" |   _   |.--------..--------..---.-..-----.\n");
   printf(" |   1___||        ||        ||  _  ||     |\n");
   printf(" |____   ||__|__|__||__|__|__||___._||__|__|\n");
   printf(" |:  1   |                                  \n");
   printf(" |::.. . |    Usage for %s :                \n", progname);
   printf(" `-------'                                  \n");
   printf("\t--help\t\t-h :\tShow this help screen\n");
   printf("\t--version\t-v :\tShow revision version\n");
   printf("\n");
   printf("\tDebugging : \n");
   printf("\t\tEINA_LOG_LEVEL=5 %s\n", progname);
}

int main(int argc, char **argv)
{
   int c;
   eina_init();
   ecore_init();
   ecore_file_init();

   send_connected = EINA_FALSE;

   while (1)
     {
        int option_index = 0;

        static struct option long_options[] = {
           {"help", 0, 0, 'h'},
           {0, 0, 0, 0}
        };

        c = getopt_long(argc, argv, "h", long_options, &option_index);
        if (c == -1) break;

        switch (c)
          {
           case 'h':
              _usage(argv[0]);
              exit(0);
           default:
              break;
          }
     }

   conf_load();
   rules_load();
   rules_print();
   spy_init();
   logfiles_print();

   ecore_main_loop_begin();

   return 0;
}