X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=thumbnailer%2Fevince-thumbnailer.c;h=9cc572f368ce242ab222783281ef010723301460;hb=e2796d0d1a833e63c9495193c9241bd718f68082;hp=ec72f16eea86d5ff09f14c916e5105397ab01a7c;hpb=4912987303aefef0d02a45726b75e5fdae043982;p=evince.git
diff --git a/thumbnailer/evince-thumbnailer.c b/thumbnailer/evince-thumbnailer.c
index ec72f16e..9cc572f3 100644
--- a/thumbnailer/evince-thumbnailer.c
+++ b/thumbnailer/evince-thumbnailer.c
@@ -27,6 +27,15 @@
#define THUMBNAIL_SIZE 128
+static gint size = THUMBNAIL_SIZE;
+static const gchar **file_arguments;
+
+static const GOptionEntry goption_options[] = {
+ { "size", 's', 0, G_OPTION_ARG_INT, &size, NULL, "SIZE" },
+ { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &file_arguments, NULL, " " },
+ { NULL }
+};
+
struct AsyncData {
EvDocument *document;
const gchar *output;
@@ -127,43 +136,65 @@ evince_thumbnail_pngenc_get_async (struct AsyncData *data)
return NULL;
}
+static void
+print_usage (GOptionContext *context)
+{
+ gchar *help;
+
+ help = g_option_context_get_help (context, TRUE, NULL);
+ g_print ("%s", help);
+ g_free (help);
+}
+
int
main (int argc, char *argv[])
{
- EvDocument *document;
- const char *input;
- const char *output;
- int size;
- char *uri;
- GFile *file;
-
- if (argc <= 2 || argc > 5 || strcmp (argv[1], "-h") == 0 ||
- strcmp (argv[1], "--help") == 0) {
- g_print ("Usage: %s [-s ]