improved help and reading user input
This commit is contained in:
+3
-7
@@ -69,7 +69,7 @@ int file_exists(char path[]) {
|
||||
*/
|
||||
void print_help_and_usage() {
|
||||
fprintf(stdout,
|
||||
"Help and usage for Wordle:\n"
|
||||
"Help and usage for wordlec:\n"
|
||||
"\n"
|
||||
"Help:\n"
|
||||
"--wordlist <path_to_wordlist_file> ........... specify a custom wordlist\n"
|
||||
@@ -77,12 +77,6 @@ void print_help_and_usage() {
|
||||
" each new line is separated by '\\n' (Enter/Return)\n"
|
||||
"--verbose .................................... be verbose (show what the program is doing aka debug info)\n"
|
||||
"--help ....................................... show this help screen\n"
|
||||
"\n"
|
||||
"Usage:\n"
|
||||
"\n"
|
||||
"wordlec ...................................... starts Wordle with the default wordlist\n"
|
||||
"\n"
|
||||
"wordlec --wordlist <path_to_wordlist_file> ... starts Wordle with a specified wordlist\n"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -156,8 +150,10 @@ void show() {
|
||||
prompt the user for their input
|
||||
*/
|
||||
void prompt(char user_input[]) {
|
||||
int c;
|
||||
printf(">> ");
|
||||
scanf("%5s", user_input);
|
||||
while ((c = getchar()) != '\n' && c != EOF);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user