Browse Source

Added help atributes to GenerateCleanText(FromFile) command-methods.

master
Craig Oates 6 years ago
parent
commit
af37d80047
  1. 43
      WetPancakeCLI/ConsoleCommands.cs

43
WetPancakeCLI/ConsoleCommands.cs

@ -57,8 +57,13 @@ namespace WetPancakeCLI
}
[ListCommand]
[Description("Generates text using the gibberish level and number of sentences specified by the user. Gibberish level must be between 2 and 20.")]
[Parameters("gibberish level: int, sentences: int")]
[Description("Generates text using the gibberish-level and number of sentences specified by the user.\n" +
"This command does not run the result through the extra \"cleaning\" process like GenerateCleanText.\n" +
"This means this command is faster but it might produce an extra sentence on the odd occasion.\n" +
"Use this if you prefer speed over accuracy.\n" +
"Gibberish-level must be between 2 and 20."
)]
[Parameters("gibberish-level: int, sentences: int")]
[Usage("> GenerateText 5 10")]
public static string GenerateText(int gibberishLevel, int sentences)
{
@ -66,7 +71,7 @@ namespace WetPancakeCLI
{
if (gibberishLevel < 2 || gibberishLevel > 20)
throw new ArgumentException
("Invalid argument. Must be between 2 and 20 (inclusive).", "gibberishLevel");
("Invalid argument. Must be between 2 and 20 (inclusive).", "gibberish-level");
if (sentences < 1)
throw new ArgumentException
("Invalid argument. Must be greater than 0.", "sentences");
@ -81,8 +86,12 @@ namespace WetPancakeCLI
}
[ListCommand]
[Description("Loads the specified .txt file and generates text based on it using the gibberish level and number of sentences specified by the user. Gibberish level must be between 2 and 20.")]
[Parameters("gibberish level: int, sentences: int, file path: string")]
[Description("Loads the specified .txt file and generates text based on it using the gibberish-level and number of sentences specified by the user.\n" +
"This command does not run the result through the extra \"cleaning\" process like GenerateCleanTextFromFile.\n" +
"This means this command is faster but it might produce an extra sentence on the odd occasion.\n" +
"Use this if you prefer speed over accuracy.\n" +
"Gibberish-level must be between 2 and 20.")]
[Parameters("gibberish-level: int, sentences: int, file path: string")]
[Usage("> GenerateTextFromFile 3 6 C:/yourfile.txt")]
public static string GenerateTextFromFile(int gibberishLevel, int sentences, string filePath)
{
@ -90,7 +99,7 @@ namespace WetPancakeCLI
{
if (gibberishLevel < 2 || gibberishLevel > 20)
throw new ArgumentException
("Invalid argument. Must be between 2 and 20 (inclusive).", "gibberishLevel");
("Invalid argument. Must be between 2 and 20 (inclusive).", "gibberish-level");
if (sentences < 1)
throw new ArgumentException
("Invalid argument. Must be greater than 0.", "sentences");
@ -130,14 +139,21 @@ namespace WetPancakeCLI
}
}
// TODO: Add "Help" attribute to GenerateCleanText command-method.
[ListCommand]
[Description("Generates text using the gibberish-level and number of sentences specified by the user.\n" +
"The result goes through an extra \"cleaning\" process to remove any artefact sentences.\n" +
"Use this if you cannot tolerate the odd extra sentence.\n" +
"With that said, it does mean it is slower than its GenerateText counterpart.\n" +
"Gibberish-level must be between 2 and 20.")]
[Parameters("gibberish-level: int, sentences: int")]
[Usage("> GenerateCleanText 5 10")]
public static string GenerateCleanText(int gibberishLevel, int sentences)
{
try
{
if (gibberishLevel < 2 || gibberishLevel > 20)
throw new ArgumentException
("Invalid argument. Must be between 2 and 20 (inclusive).", "gibberishLevel");
("Invalid argument. Must be between 2 and 20 (inclusive).", "gibberish-Level");
if (sentences < 1)
throw new ArgumentException
("Invalid argument. Must be greater than 0.", "sentences");
@ -151,14 +167,21 @@ namespace WetPancakeCLI
}
}
//TODO: Add "Help" attribute to GenerateCleanTextFromFile command-method.
[ListCommand]
[Description("Loads the specified .txt file and generates text based on it, using the gibberish-level and number of specified by the user.\n" +
"The result goes through an extra \"cleaning\" process to remove any artefact sentences.\n" +
"Use this if you cannot tolerate the odd extra sentence.\n" +
"With that said, it does mean it is slower than its GenerateTextFromFile counterpart.\n" +
"Gibberish-level must be between 2 and 20.")]
[Parameters("gibberish-level: int, sentences: int, file path: string")]
[Usage("> GenerateCleanTextFromFile 3 6 C:/yourfile.txt")]
public static string GenerateCleanTextFromFile(int gibberishLevel, int sentences, string filePath)
{
try
{
if (gibberishLevel < 2 || gibberishLevel > 20)
throw new ArgumentException
("Invalid argument. Must be between 2 and 20 (inclusive).", "gibberishLevel");
("Invalid argument. Must be between 2 and 20 (inclusive).", "gibberish-Level");
if (sentences < 1)
throw new ArgumentException
("Invalid argument. Must be greater than 0.", "sentences");

Loading…
Cancel
Save