fixes, refacts
This commit is contained in:
31
cli/Commands/AuthCommander.cs
Normal file
31
cli/Commands/AuthCommander.cs
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
using cli.Model;
|
||||
using Microsoft.Extensions.CommandLineUtils;
|
||||
|
||||
namespace cli.Commands
|
||||
{
|
||||
public class AuthCommander : ICommander
|
||||
{
|
||||
public CommandLineApplication Integrate(CommandLineApplication rootApp)
|
||||
{
|
||||
|
||||
CommandLineApplication authApp = rootApp.Command("auth",
|
||||
(target) =>
|
||||
{
|
||||
target.FullName = "Authentication methods";
|
||||
target.Description = "Login, save credentials and get authorized.";
|
||||
target.HelpOption("-? | -h | --help");
|
||||
var loginCommand = target.Command("login", app => {
|
||||
var loginarg = app.Argument("login", "login to use", true);
|
||||
app.Option( "-s | --save", "Save authentication token to file", CommandOptionType.NoValue);
|
||||
app.HelpOption("-? | -h | --help");
|
||||
} );
|
||||
}, false);
|
||||
authApp.OnExecute(()=>
|
||||
{
|
||||
return 0;
|
||||
});
|
||||
return authApp;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,12 +1,28 @@
|
||||
|
||||
using cli.Model;
|
||||
using Microsoft.Extensions.CommandLineUtils;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using cli.Services;
|
||||
|
||||
namespace cli {
|
||||
|
||||
public class CiBuildCommand {
|
||||
namespace cli
|
||||
{
|
||||
|
||||
public class CiBuildCommand : ICommander
|
||||
{
|
||||
public CommandLineApplication Integrate(CommandLineApplication rootApp)
|
||||
{
|
||||
CommandLineApplication ciBuildApp = rootApp.Command("build",
|
||||
(target) =>
|
||||
{
|
||||
target.FullName = "Build this project.";
|
||||
target.Description = "Build this project, as specified in .paul-ci.json";
|
||||
target.HelpOption("-? | -h | --help");
|
||||
}, false);
|
||||
ciBuildApp.OnExecute(()=>
|
||||
{
|
||||
|
||||
|
||||
return 0;
|
||||
});
|
||||
return ciBuildApp;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,19 +1,15 @@
|
||||
|
||||
using Microsoft.AspNet.Hosting;
|
||||
using Microsoft.Extensions.CommandLineUtils;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using cli.Services;
|
||||
using System.Threading.Tasks;
|
||||
using NJsonSchema;
|
||||
using System.IO;
|
||||
using cli.Model;
|
||||
|
||||
namespace cli
|
||||
{
|
||||
|
||||
public class GenerateJsonSchema
|
||||
public class GenerateJsonSchema : ICommander
|
||||
{
|
||||
public CommandLineApplication Integrates(CommandLineApplication rootApp)
|
||||
public CommandLineApplication Integrate(CommandLineApplication rootApp)
|
||||
{
|
||||
CommandArgument genargclass = null;
|
||||
CommandArgument genargjson = null;
|
||||
|
@ -4,11 +4,12 @@ using Microsoft.Extensions.CommandLineUtils;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using cli.Services;
|
||||
using cli.Model;
|
||||
|
||||
namespace cli {
|
||||
|
||||
public class SendMailCommandProvider : ICliCommand {
|
||||
public CommandLineApplication Integrates(CommandLineApplication rootApp)
|
||||
public class SendMailCommandProvider : ICommander {
|
||||
public CommandLineApplication Integrate(CommandLineApplication rootApp)
|
||||
{
|
||||
CommandArgument sendMailCommandArg = null;
|
||||
CommandOption sendHelpOption = null;
|
||||
|
Reference in New Issue
Block a user