diff options
Diffstat (limited to 'src/cgg.c')
| -rw-r--r-- | src/cgg.c | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -44,22 +44,24 @@ * parse_cmd: parse commandline and fill global variable parameters */ gboolean -parse_cmd (int argc, char* argv[], gchar **source_dir, gchar **dst_dir, gboolean *verbose, int *jobs, gboolean *update) +parse_cmd (int argc, char* argv[], gchar **source_dir, gchar **dst_dir, gboolean *verbose, int *jobs, gboolean *update, gboolean *override_nofullsize) { static gboolean _verbose = FALSE; static gchar *_source_dir = NULL; static gchar *_dst_dir = NULL; static int _jobs = 1; static gboolean _update = FALSE; + static gboolean _override_nofullsize = FALSE; static GOptionEntry entries[] = { - { "verbose", 'v', 0, G_OPTION_ARG_NONE, &_verbose, "Be verbose", NULL }, - { "source", 's', 0, G_OPTION_ARG_STRING, &_source_dir, "Specifies a path to source structure", NULL }, - { "output", 'o', 0, G_OPTION_ARG_STRING, &_dst_dir, "Generate files to the specified directory instead of current", NULL }, + { "verbose", 'v', 0, G_OPTION_ARG_NONE, &_verbose, "Be verbose", NULL }, + { "source", 's', 0, G_OPTION_ARG_STRING, &_source_dir, "Specifies a path to source structure", NULL }, + { "output", 'o', 0, G_OPTION_ARG_STRING, &_dst_dir, "Generate files to the specified directory instead of current", NULL }, { "jobs", 'j', 0, G_OPTION_ARG_INT, &_jobs, "Allow N jobs at once (default=1)", NULL }, { "update", 'u', 0, G_OPTION_ARG_NONE, &_update, "Update the output structure", NULL }, - { NULL } + { "fullsize", 'f', 0, G_OPTION_ARG_NONE, &_override_nofullsize, "Override the nofullsize switch and generate full gallery", NULL }, + { NULL } }; GError *error = NULL; @@ -97,6 +99,7 @@ parse_cmd (int argc, char* argv[], gchar **source_dir, gchar **dst_dir, gboolean *verbose = _verbose; *jobs = _jobs; *update = _update; + *override_nofullsize = _override_nofullsize; return TRUE; } @@ -110,6 +113,7 @@ main (int argc, char* argv[]) gchar *dst_dir; gboolean verbose; gboolean update; + gboolean fullsize; int jobs; TGallerySetup *setup; time_t time_start = time (NULL); @@ -134,7 +138,7 @@ main (int argc, char* argv[]) /* Parse commandline */ - if (! parse_cmd (argc, argv, &source_dir, &dst_dir, &verbose, &jobs, &update)) + if (! parse_cmd (argc, argv, &source_dir, &dst_dir, &verbose, &jobs, &update, &fullsize)) return -1; if ((! source_dir) || (access (source_dir, R_OK))) { @@ -172,6 +176,7 @@ main (int argc, char* argv[]) /* Start building the gallery tree */ setup->verbose = verbose; setup->update_mode = update; + setup->override_nofullsize = fullsize; build_tree (setup, source_dir, dst_dir, NULL, -1, jobs); if (verbose) { |
