shithub: neatpost

Download patch

ref: a79e7c463a998eb249b2c6d0d010e7540a329ce2
parent: 5c912d084931b4aa91103718bc8d59c2c982d9ad
author: aabacchus <bvnfuller@gmail.com>
date: Sun May 22 18:51:23 EDT 2022

post: print usage to stderr and return 1 on bad options

so that if an incorrect option is given in a pipeline, the error message can be seen.

--- a/post.c
+++ b/post.c
@@ -640,8 +640,8 @@
 		} else if (argv[i][0] == '-' && argv[i][1] == 'l') {
 			landscape = 1;
 		} else {
-			printf("%s", usage);
-			return 0;
+			fprintf(stderr, "%s", usage);
+			return 1;
 		}
 	}
 	if (landscape) {