|
|
|
@ -10,7 +10,7 @@
@@ -10,7 +10,7 @@
|
|
|
|
|
int rainbow_len = 90; // how many characters long is one full rainbow (360deg)
|
|
|
|
|
int col_change; // how many degrees between colours in the rainbow
|
|
|
|
|
int col_dist; // how many characters per colour in output
|
|
|
|
|
int frequency = 1; // how many degrees to rotate start point on new line
|
|
|
|
|
int frequency = 0; // how many degrees to rotate start point on new line
|
|
|
|
|
|
|
|
|
|
struct colour* colours; // the rainbow
|
|
|
|
|
int num_colours; // the length of the rainbow
|
|
|
|
@ -94,16 +94,16 @@ int generate_rainbow() {
@@ -94,16 +94,16 @@ int generate_rainbow() {
|
|
|
|
|
int main(int argc, char** argv) { |
|
|
|
|
int opt; |
|
|
|
|
int optcount = 0; |
|
|
|
|
while ((opt = getopt(argc, argv, "l:f:")) != -1) { |
|
|
|
|
while ((opt = getopt(argc, argv, "h:v:")) != -1) { |
|
|
|
|
optcount++; |
|
|
|
|
if (opt == 'l') { |
|
|
|
|
if (opt == 'h') { |
|
|
|
|
optcount++; |
|
|
|
|
rainbow_len = atoi(optarg); |
|
|
|
|
} else if (opt == 'f') { |
|
|
|
|
} else if (opt == 'v') { |
|
|
|
|
optcount++; |
|
|
|
|
frequency = atoi(optarg); |
|
|
|
|
} else { |
|
|
|
|
printf("Usage: colcat -l [rainbow length] -f [frequency]"); |
|
|
|
|
printf("Usage: colcat -h [rainbow length] -v [vertical frequency]"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|