9 char name
[] = "Sigil Utilities, version";
10 char contact
[] = "(C) 2020 theblaqcksquid <theblacksquid@subvertising.org>\n";
11 char license
[] = "Licensed under GNU GPL v3\n";
13 char help0
[] = "usage: sigutils [options] <STATEMENT OF INTENT>\n";
14 char help1
[] = "-h Print this message and quit.\n";
15 char help2
[] = "-v Print the version and license info, then quit.\n";
16 char help3
[] = "-n Append the numerical and root values to the result.\n";
17 char help4
[] = "-w Generate a Word Square based on the SOI\n";
18 char help5
[] = "-W Generate word square ONLY.\n";
20 int main(int argc
, char** argv
)
26 int word_only_flag
= 0;
29 while ((c
= getopt(argc
, argv
, "nvhwW")) != -1)
32 case 'n': numeric_flag
= 1;
35 case 'v': version_flag
= 1;
38 case 'h': help_flag
= 1;
41 case 'w': word_flag
= 1;
44 case 'W': word_only_flag
= 1;
50 printf("%s %.2f\n%s%s", name
, VERSION
, contact
, license
);
56 printf("%s%s%s%s%s%s", help0
, help1
, help2
, help3
, help4
, help5
);
60 char* raw
= absorb_words(argc
, argv
, optind
);
61 char* result
= string_process(raw
);
68 int value
= string_value(result
, LETTERS
);
69 int root
= digital_root(value
, 10);
70 printf(" %d %d", value
, root
);
73 if (word_flag
|| word_only_flag
)
75 printf("%s", generate_square(result
));