Browse Source

Refactored command-methods to one-liners.

master
Craig Oates 6 years ago
parent
commit
523b2998ab
  1. 18
      WetPancakeCLI/ConsoleCommands.cs

18
WetPancakeCLI/ConsoleCommands.cs

@ -30,30 +30,18 @@ namespace WetPancakeCLI
[Description("Generates random text, the number of sentences generated is randomly determined.")]
[Parameters("none")]
[Usage("> GenerateRandomText")]
public static string GenerateRandomText()
{
var result = RequestRandomText();
return result;
}
public static string GenerateRandomText() => RequestRandomText();
[ListCommand]
[Description ("Generates text using the gibberish level and number of sentences specified by the user.")]
[Parameters("gibberish level: int, sentences: int")]
[Usage("> GenerateText 5 10")]
public static string GenerateText(int gibberishLevel, int sentences)
{
var result = RequestText(gibberishLevel, sentences);
return result;
}
public static string GenerateText(int gibberishLevel, int sentences) => RequestText(gibberishLevel, sentences);
[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.")]
[Parameters("gibberish level: int, sentences: int, file path: string")]
[Usage("> RequestTextFromFile 3 6 C:/yourfile.txt")]
public static string RequestTextFromFile(int gibberishLevel, int sentences, string filePath)
{
var result = RequestTextFromFile(gibberishLevel, sentences, filePath);
return result;
}
public static string RequestTextFromFile(int gibberishLevel, int sentences, string filePath) => RequestTextFromFile(gibberishLevel, sentences, filePath);
}
}

Loading…
Cancel
Save