|
|
|
@ -75,6 +75,7 @@ namespace WetPancakeCLI
|
|
|
|
|
[Usage("> GenerateTextFromFile 3 6 C:/yourfile.txt")] |
|
|
|
|
public static string GenerateTextFromFile(int gibberishLevel, int sentences, string filePath) |
|
|
|
|
{ |
|
|
|
|
// Should these checks be moved into the main library? How are people going to now to add these themselves when they are new to the project? |
|
|
|
|
if (gibberishLevel < 2 || gibberishLevel > 20) throw new ArgumentException("Invalid argument. Must be between 2 and 20 (inclusive).", "gibberishLevel"); |
|
|
|
|
if (sentences < 1) throw new ArgumentException("Invalid argument. Must be greater than 0.", "sentences"); |
|
|
|
|
if (Path.GetExtension(filePath) != ".txt") throw new FileLoadException("The file entered is not a plain text (.txt) file.", filePath); |
|
|
|
|