This commit is contained in:
Paul Schneider 2018-07-30 11:21:57 +02:00
commit 6e5b27d2f0
6 changed files with 100 additions and 12 deletions

View file

@ -7,19 +7,19 @@ using cli.Services;
namespace cli {
public class SendMailCommandProvider {
public static CommandLineApplication Handle(CommandLineApplication rootApp)
public class SendMailCommandProvider : ICliCommand {
public CommandLineApplication Integrates(CommandLineApplication rootApp)
{
CommandArgument _sendMailCommandArg = null;
CommandOption _sendHelpOption = null;
CommandArgument sendMailCommandArg = null;
CommandOption sendHelpOption = null;
CommandLineApplication sendMailCommandApp
= rootApp.Command("send",
(target) =>
{
target.FullName = "Send email";
target.Description = "Sends emails using given template";
_sendHelpOption = target.HelpOption("-? | -h | --help");
_sendMailCommandArg = target.Argument(
sendHelpOption = target.HelpOption("-? | -h | --help");
sendMailCommandArg = target.Argument(
"class",
"class name of mailling to execute (actually, only 'monthly') .",
multipleValues: true);
@ -27,7 +27,7 @@ public class SendMailCommandProvider {
sendMailCommandApp.OnExecute(() =>
{
if (_sendMailCommandArg.Value == "monthly")
if (sendMailCommandArg.Value == "monthly")
{
var host = new WebHostBuilder();
var hostengnine = host.UseEnvironment("Development")