cropper

diff 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
line diff
     1.1 --- a/main.c	Wed Dec 05 00:08:39 2007 +0100
     1.2 +++ b/main.c	Fri Dec 07 17:40:08 2007 +0100
     1.3 @@ -7,6 +7,23 @@
     1.4  
     1.5  int main (int argc, char *argv[]) {
     1.6  
     1.7 +	/* printf("argc: %i\nargv[0]: %s\nargv[1]: %s\nargv[2]: %s\n", argc, argv[0], argv[1], argv[2]); */
     1.8 +
     1.9 +	/* commandline option handling */
    1.10 +	if (argc == 2) {
    1.11 +		if (strcmp(argv[1], "--version") == 0) {
    1.12 +			g_print("cropper - a crop frontend for convert\nversion 0.1\nhttp://prog.marmaro.de\n");
    1.13 +			return(0);
    1.14 +		} else {
    1.15 +			image_filename = argv[1];
    1.16 +		}
    1.17 +	} else {
    1.18 +		g_print("usage: %s <image>\n", argv[0]);
    1.19 +		return(1);
    1.20 +	}
    1.21 +
    1.22 +
    1.23 +
    1.24    gtk_set_locale ();
    1.25    gtk_init (&argc, &argv);
    1.26