Skip to content

Commit bbd6104

Browse files
committed
fix: merge
2 parents c54dfc7 + 4b01097 commit bbd6104

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

filter.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
int main(int argc, char *argv[])
99
{
1010
// Define allowable filters
11-
char *filters = "bgrsivtdGoB:";
11+
char *filters = "bgrsivtmdGoB:";
1212

1313
// Allocate filter array
1414
char *filterArr = (char *)malloc((argc - 2) * sizeof(char));
@@ -36,13 +36,27 @@ int main(int argc, char *argv[])
3636
return 1;
3737
}
3838
filterArr[filterCount++] = opt;
39+
} else if (opt == 'm') {
40+
printf("\nAvailable filters:\n");
41+
printf(" -b Blur\n");
42+
printf(" -g Grayscale\n");
43+
printf(" -r Reflect\n");
44+
printf(" -s Sepia\n");
45+
printf(" -i Invert\n");
46+
printf(" -v Vignette\n");
47+
printf(" -t Threshold\n");
48+
printf(" -d Detect edges\n");
49+
printf(" -B <value> Adjust brightness\n");
50+
printf(" -G Glow\n");
51+
printf(" -o Oil paint\n");
52+
printf(" -m Show this menu\n\n");
53+
free(filterArr);
54+
return 0;
3955
} else {
4056
filterArr[filterCount++] = opt;
4157
}
4258
}
43-
4459

45-
// Ensure proper usage
4660
if (argc < optind + 2)
4761
{
4862
printf("Usage: ./filter [flag] infile outfile\n");

0 commit comments

Comments
 (0)