diff --git a/basic.c b/basic.c index e10c9c5..afe5452 100644 --- a/basic.c +++ b/basic.c @@ -1,7 +1,5 @@ #include "basic.h" -#include - #include "draw.h" void rainbow_8() { diff --git a/full.c b/full.c index 7bab152..52a7501 100644 --- a/full.c +++ b/full.c @@ -1,7 +1,5 @@ #include "full.h" -#include - #include "draw.h" void rainbow_256() { diff --git a/main.c b/main.c index 3195111..09a782e 100644 --- a/main.c +++ b/main.c @@ -2,11 +2,10 @@ #include #include -#include "draw.h" #include "basic.h" #include "full.h" -#define VERSION "0.0.3" +#define VERSION "0.0.4" #define RESET "\x1b[0m" @@ -34,11 +33,11 @@ void help() { ); } -unsigned long djb_hash(unsigned char *string) { +unsigned long djb_hash(char *string) { unsigned long output = 5381; int c; - while(c = *string++) + while((c = *string++)) output = ((output << 5) + output) + c; return output; @@ -55,15 +54,6 @@ int main(int argc, char **argv) { if(colorterm != NULL && strcmp(colorterm, "")) color_mode = 1; - // handle flags - if(strcmp(flag, "--version") == 0) { - version(); - return 0; - } else if(strcmp(flag, "--help") == 0) { - help(); - return 0; - } - unsigned long flag_hash = djb_hash(flag); char *output; @@ -124,6 +114,17 @@ int main(int argc, char **argv) { else transgender_8(); break; + + // handle flags, but in the command-line sense + case 6951207451432lu: // --help + case 5861498lu: // -h + help(); + break; + case 249805560270004805lu: // --version + case 5861512lu: // -v + version(); + break; + default: printf("pride-c: no flag '%s' found.", flag); return 1;