diff --git a/cli/Squidex.CLI/Directory.Build.props b/cli/Squidex.CLI/Directory.Build.props index 855a3b38..fc03e7c8 100644 --- a/cli/Squidex.CLI/Directory.Build.props +++ b/cli/Squidex.CLI/Directory.Build.props @@ -8,6 +8,6 @@ MIT https://github.com/Squidex/squidex/ Squidex HeadlessCMS - 8.12 + 8.13 diff --git a/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/Sync/SyncService.cs b/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/Sync/SyncService.cs index 63882148..9e7271a4 100644 --- a/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/Sync/SyncService.cs +++ b/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/Sync/SyncService.cs @@ -71,7 +71,7 @@ public SyncService(IFileSystem fileSystem, ISession session) schema.AdditionalPropertiesSchema = new JsonSchema { - Description = "Any" + Description = "Any." }; })); diff --git a/cli/Squidex.CLI/Squidex.CLI/Commands/App_Apps.cs b/cli/Squidex.CLI/Squidex.CLI/Commands/App_Apps.cs index 791120ba..b44491d7 100644 --- a/cli/Squidex.CLI/Squidex.CLI/Commands/App_Apps.cs +++ b/cli/Squidex.CLI/Squidex.CLI/Commands/App_Apps.cs @@ -76,9 +76,31 @@ public async Task Create(CreateArguments arguments) log.WriteLine("> App created."); } + [Command("delete", Description = "Delete the app.")] + public async Task Delete(DeleteArguments arguments) + { + var session = configuration.StartSession(arguments.App); + + var name = arguments.App; + + if (string.IsNullOrWhiteSpace(name)) + { + name = session.App; + } + + if (!string.Equals(name, arguments.Confirm, StringComparison.Ordinal)) + { + throw new CLIException("Confirmed app name does not match."); + } + + await session.Apps.DeleteAppAsync(name); + + log.WriteLine("> App deleted."); + } + public sealed class ListArguments : AppArguments { - [Option('t', "table", Description = "Output as table")] + [Option('t', "table", Description = "Output as table.")] public bool Table { get; set; } public sealed class Validator : AbstractValidator @@ -92,6 +114,16 @@ public sealed class Validator : AbstractValidator { } } + + public sealed class DeleteArguments : AppArguments + { + [Option("confirm", Description = "Confirm the name of the app.")] + public string Confirm { get; set; } + + public sealed class Validator : AbstractValidator + { + } + } } } } diff --git a/cli/Squidex.CLI/Squidex.CLI/Commands/App_Backup.cs b/cli/Squidex.CLI/Squidex.CLI/Commands/App_Backup.cs index ae81c772..b787b007 100644 --- a/cli/Squidex.CLI/Squidex.CLI/Commands/App_Backup.cs +++ b/cli/Squidex.CLI/Squidex.CLI/Commands/App_Backup.cs @@ -98,7 +98,7 @@ public sealed class CreateArguments : AppArguments [Option("timeout", Description = "The timeout to wait for the backup in minutes.")] public int Timeout { get; set; } = 30; - [Option("deleteAfterDownload", Description = "Defines if the created backup shall be deleted from app after the backup task is completed")] + [Option("deleteAfterDownload", Description = "Defines if the created backup shall be deleted from app after the backup task is completed.")] public bool DeleteAfterDownload { get; set; } public sealed class Validator : AbstractValidator diff --git a/cli/Squidex.CLI/Squidex.CLI/Commands/App_Config.cs b/cli/Squidex.CLI/Squidex.CLI/Commands/App_Config.cs index 5bdf98b1..66025cb6 100644 --- a/cli/Squidex.CLI/Squidex.CLI/Commands/App_Config.cs +++ b/cli/Squidex.CLI/Squidex.CLI/Commands/App_Config.cs @@ -97,7 +97,7 @@ public void Reset() public sealed class ListArguments : IArgumentModel { - [Option('t', "table", Description = "Output as table")] + [Option('t', "table", Description = "Output as table.")] public bool Table { get; set; } public sealed class Validator : AbstractValidator diff --git a/cli/Squidex.CLI/Squidex.CLI/Commands/App_Schemas.cs b/cli/Squidex.CLI/Squidex.CLI/Commands/App_Schemas.cs index b7bd07f9..9d081747 100644 --- a/cli/Squidex.CLI/Squidex.CLI/Commands/App_Schemas.cs +++ b/cli/Squidex.CLI/Squidex.CLI/Commands/App_Schemas.cs @@ -164,7 +164,7 @@ public async Task Sync(SyncArguments arguments) public sealed class ListArguments : AppArguments { - [Option('t', "table", Description = "Output as table")] + [Option('t', "table", Description = "Output as table.")] public bool Table { get; set; } public sealed class Validator : AbstractValidator diff --git a/cli/Squidex.CLI/Squidex.CLI/Commands/App_Sync.cs b/cli/Squidex.CLI/Squidex.CLI/Commands/App_Sync.cs index 736d6208..84bee6b2 100644 --- a/cli/Squidex.CLI/Squidex.CLI/Commands/App_Sync.cs +++ b/cli/Squidex.CLI/Squidex.CLI/Commands/App_Sync.cs @@ -42,7 +42,7 @@ public async Task New(NewArgument arguments) log.WriteLine("> Folder generated."); } - [Command("out", Description = "Exports the app to a folder")] + [Command("out", Description = "Exports the app to a folder.")] public async Task Out(OutArguments arguments) { var session = configuration.StartSession(arguments.App); @@ -57,7 +57,7 @@ public async Task Out(OutArguments arguments) log.WriteLine("> Synchronization completed."); } - [Command("in", Description = "Imports the app from a folder")] + [Command("in", Description = "Imports the app from a folder.")] public async Task In(InArguments arguments) { var session = configuration.StartSession(arguments.App, arguments.Emulate); @@ -77,7 +77,7 @@ public async Task Describe(DescribeArguments arguments) log.WriteLine("> Describing completed."); } - [Command("targets", Description = "List all targets")] + [Command("targets", Description = "List all targets.")] public void Targets() { foreach (var target in synchronizer.GetTargets())