summaryrefslogtreecommitdiff
path: root/src/argent.c
blob: c42161a23aed3234f8abf7e97382bba0acbd18bc (plain)
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
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>

#include "honeysuckle.h"
#include "md4c-html.h"
#include "tinydir.h"

#include "options.h"


int main(int argc, char **argv)
{
   struct argent_options opts;
   int error = parse_options(&opts, argc, argv);

   if (error)
      return 1;

   printf("configuration file: %s\n"
	  "output directory: %s\n",
	  opts.conf_filename,
	  opts.output_dir);

   lua_State *L = luaL_newstate();
   luaL_openlibs(L);

   error = luaL_dofile(L, opts.conf_filename);
   if (error != 0) {
      fprintf(stderr, "error: %s\n", lua_tostring(L, -1));
   }
   
   lua_close(L);
   return 0;
}