From dc314c90fc0bb4ed5d48279080bcc56f3fa09b2c Mon Sep 17 00:00:00 2001 From: Pete Warden Date: Sun, 2 Jan 2022 16:24:44 -0800 Subject: [PATCH] Updated language help --- args.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/args.h b/args.h index 23b1fca..82a9b6f 100644 --- a/args.h +++ b/args.h @@ -56,7 +56,6 @@ char* hot_words = NULL; const std::string ListAvailableLanguages() { std::string result; - fprintf(stderr, "Looking for '%s'\n", languages_dir.c_str()); DIR* dp = opendir(languages_dir.c_str()); if (dp != NULL) { @@ -66,13 +65,10 @@ const std::string ListAvailableLanguages() { if (ep->d_name[0] == '.') { continue; } - if (result.length() == 0) { - result += ep->d_name; - } - else { - result += "|"; - result += ep->d_name; + if (result.length() != 0) { + result += ", "; } + result += "'" + std::string(ep->d_name) + "'"; } closedir(dp); } @@ -82,11 +78,11 @@ const std::string ListAvailableLanguages() { void PrintHelp(const char* bin) { std::cout << - "Usage: " << bin << " [--source mic|system|file] [--language " + ListAvailableLanguages() + "] \n" + "Usage: " << bin << " [--source mic|system|file] [--language ] \n" "\n" "Speech recognition tool to convert audio to text transcripts.\n" "\n" - "\t--language\tWhich language to look for (default '" << language << "')\n" + "\t--language\tWhich language to look for (default '" << language << "', can be " << ListAvailableLanguages() << ")\n" "\t--source NAME\tName of the audio source (default 'mic', can also be 'system', 'file')\n" "\t--help\t\tShow help\n" "\nAdvanced settings:\n\n"