nice text
This commit is contained in:
parent
9adaa9171a
commit
d7966375f1
2 changed files with 13 additions and 4 deletions
15
glonkers.c
15
glonkers.c
|
|
@ -11,6 +11,10 @@
|
|||
#include "wayland.h"
|
||||
#include <string.h>
|
||||
|
||||
void print_help(FILE *channel, char *bin_path) {
|
||||
fprintf(channel, "Usage: %s [OPTION]... [PATH]\n", bin_path);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
char *shader_path = NULL;
|
||||
int output_type = OUTPUT_WINDOW;
|
||||
|
|
@ -19,7 +23,11 @@ int main(int argc, char *argv[]) {
|
|||
int output_count;
|
||||
// syntax: --window for a normal window or --layer for a wallpaper
|
||||
for (int i = 1; i < argc; i++) {
|
||||
if (strcmp("--window", argv[i]) == 0) {
|
||||
if (strcmp("--help", argv[i]) == 0) {
|
||||
print_help(stdout, argv[0]);
|
||||
return 0;
|
||||
}
|
||||
else if (strcmp("--window", argv[i]) == 0) {
|
||||
output_type = OUTPUT_WINDOW;
|
||||
currently_reading_output = false;
|
||||
}
|
||||
|
|
@ -41,14 +49,15 @@ int main(int argc, char *argv[]) {
|
|||
else if (!currently_reading_output) {
|
||||
// path to fragment shader
|
||||
if (shader_path != NULL) {
|
||||
fprintf(stderr, "tried supplying '%s' as a shader file while one has already been selected\n", argv[i]);
|
||||
fprintf(stderr, "Tried supplying '%s' as a shader file while one has already been selected.\n", argv[i]);
|
||||
return 1;
|
||||
}
|
||||
shader_path = argv[i];
|
||||
}
|
||||
}
|
||||
if (shader_path == NULL) {
|
||||
printf("need to supply path to shader\n");
|
||||
fprintf(stderr, "Need to supply path to shader!\n");
|
||||
print_help(stderr, argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue