comparison main.c @ 4:2f11ab3e6047

added option handling; added output for convert; commented all ratio code cause it is not really important now
author meillo@marmaro.de
date Fri, 07 Dec 2007 17:40:08 +0100
parents e359bea4c8ac
children 61e5a1727231
comparison
equal deleted inserted replaced
3:6aaba3a61563 4:2f11ab3e6047
4 #include "interface.h" 4 #include "interface.h"
5 #include "support.h" 5 #include "support.h"
6 6
7 7
8 int main (int argc, char *argv[]) { 8 int main (int argc, char *argv[]) {
9
10 /* printf("argc: %i\nargv[0]: %s\nargv[1]: %s\nargv[2]: %s\n", argc, argv[0], argv[1], argv[2]); */
11
12 /* commandline option handling */
13 if (argc == 2) {
14 if (strcmp(argv[1], "--version") == 0) {
15 g_print("cropper - a crop frontend for convert\nversion 0.1\nhttp://prog.marmaro.de\n");
16 return(0);
17 } else {
18 image_filename = argv[1];
19 }
20 } else {
21 g_print("usage: %s <image>\n", argv[0]);
22 return(1);
23 }
24
25
9 26
10 gtk_set_locale (); 27 gtk_set_locale ();
11 gtk_init (&argc, &argv); 28 gtk_init (&argc, &argv);
12 29
13 add_pixmap_directory ("/usr/share/pixmaps"); 30 add_pixmap_directory ("/usr/share/pixmaps");