gout

A static git page generator
git clone https://git.bracken.jp/gout.git
Log | Files | Refs | README | LICENSE

gout_index_main.c (678B)


      1 #include "gout_index.h"
      2 
      3 #include <locale.h>
      4 #include <stdio.h>
      5 #include <stdlib.h>
      6 
      7 #include "fs_posix.h"
      8 
      9 static void gout_index_usage(const char* program_name) {
     10   fprintf(stderr, "usage: %s [-H | -G | -M] [-m me_url] [repodir...]\n",
     11           program_name);
     12 }
     13 
     14 int main(int argc, const char* argv[]) {
     15   setlocale(LC_ALL, "");
     16   GoutIndexOptions* options = gout_index_options_create(argc, argv);
     17   if (options == NULL) {
     18     gout_index_usage(argv[0]);
     19     exit(1);
     20   }
     21 
     22   Git* git = gout_git_create(g_fs_posix);
     23   gout_index_init(options, git);
     24   gout_index_run(options, git);
     25 
     26   git->shutdown(git);
     27   gout_git_free(git);
     28 
     29   gout_index_options_free(options);
     30   return 0;
     31 }