#include <glib.h>
#include <stdio.h>
#include <string.h>

gchar *filename;

struct GOptionEntry options[] = {
	{ "file", 'f', 0, G_OPTION_ARG_FILENAME, &filename,
	  "Test file", "FILE" },
	{ NULL }
};

int main(int argc, char **argv)
{
	GOptionContext *context;
	GCommandLine *cmd;
	gboolean ret;
	int ret_strcmp;
	gchar *contents;
	
	context = g_option_context_new (" - Glib test helper");
	g_option_context_add_main_entries (context, entries, "option-unicode");
	
	cmd = g_command_line_new(argc, argv);
	ret = g_option_context_parse(context, cmd, NULL));
	if (ret != TRUE) return 1;
	
	ret = g_file_get_contents (filename, &contents, NULL, NULL);
	if (ret != TRUE) return 2;
	
	ret_strcmp = strcmp (filename, contents);
	if (ret_strcmp != 0) return 3;
	
	return 0;
}