usrlib.de / CVS

Diff for revision 1.12 of bgset/bgset.c

--- //cvs/lukas/bgset/bgset.c	2016/09/03 20:30:02	1.11
+++ //cvs/lukas/bgset/bgset.c	2016/09/05 23:08:50	1.12
@@ -138,7 +138,7 @@
 
 void
 usage(char *myname) {
-	fprintf(stderr, "usage: %s [-c file] [-t file] [-s file] [-f file]\n",
+	fprintf(stderr, "usage: %s -n | -cCfFsStT file [...]\n",
 	    myname);
 }
 
@@ -187,28 +187,25 @@
 
 	/* parse command line and draw images */
 	for (i = 0; i < scrnum; i++) {
-		if ((opt = getopt(argc, argv, "c:t:s:f:n")) == -1) {
+		if ((opt = getopt(argc, argv, "c:C:t:T:s:S:f:F:n")) == -1) {
 			break;
 		}
 
-		if (info) {
-			x = info[i].x_org;
-			y = info[i].y_org;
-			w = info[i].width;
-			h = info[i].height;
-		}
-
 		switch (opt) {
 		case 'c':
+		case 'C':
 			mode = BGM_CENTER;
 			break;
 		case 't':
+		case 'T':
 			mode = BGM_TILE;
 			break;
 		case 's':
+		case 'S':
 			mode = BGM_SCALE;
 			break;
 		case 'f':
+		case 'F':
 			mode = BGM_FILL;
 			break;
 		case 'n':
@@ -217,6 +214,13 @@
 			usage(argv[0]);
 			x_teardown(dpy, info);
 			return 1;
+		}
+
+		if (info && opt >= 'a') {
+			x = info[i].x_org;
+			y = info[i].y_org;
+			w = info[i].width;
+			h = info[i].height;
 		}
 
 		if (!(draw_image(dpy, scr, root, optarg, mode, x, y, w, h))) {