From 5302d31c61251e7cc4e8e41e7fa2d9ed975fd090 Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Tue, 21 Feb 2023 21:08:06 +0100 Subject: [PATCH 1/2] Add vscode folder to gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3014170..d1d1944 100644 --- a/.gitignore +++ b/.gitignore @@ -362,4 +362,5 @@ MigrationBackup/ # Fody - auto-generated XML schema FodyWeavers.xsd -launchSettings.json \ No newline at end of file +launchSettings.json +.vscode/** \ No newline at end of file From f7493ca8bd7fc58bcb6835a30553aed5f87b6807 Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Tue, 21 Feb 2023 21:28:18 +0100 Subject: [PATCH 2/2] Add examples to every command Fix spelling mistake --- .../Commands/Cli/ManuelDatabaseCommand.cs | 8 +-- ...gs.cs => ManuelDatabaseCommandSettings.cs} | 2 +- src/IL2CareerToolset/Program.cs | 56 ++++++++++++++----- 3 files changed, 48 insertions(+), 18 deletions(-) rename src/IL2CareerToolset/Commands/Cli/Settings/{ManuellDatabaseCommandSettings.cs => ManuelDatabaseCommandSettings.cs} (83%) diff --git a/src/IL2CareerToolset/Commands/Cli/ManuelDatabaseCommand.cs b/src/IL2CareerToolset/Commands/Cli/ManuelDatabaseCommand.cs index 1488069..a8962af 100644 --- a/src/IL2CareerToolset/Commands/Cli/ManuelDatabaseCommand.cs +++ b/src/IL2CareerToolset/Commands/Cli/ManuelDatabaseCommand.cs @@ -9,20 +9,20 @@ namespace IL2CareerToolset.Commands.Cli; [Description("Command to set the game path by yourself")] -internal class ManuellDatabaseCommand : Command +internal class ManuelDatabaseCommand : Command { private readonly IGamePathValidationService pathValidationService; private readonly ISettingsService settingsService; - private readonly ILogger logger; + private readonly ILogger logger; - public ManuellDatabaseCommand(IGamePathValidationService pathValidationService, ISettingsService settingsService, ILogger logger) + public ManuelDatabaseCommand(IGamePathValidationService pathValidationService, ISettingsService settingsService, ILogger logger) { this.pathValidationService = pathValidationService; this.settingsService = settingsService; this.logger = logger; } - public override int Execute([NotNull] CommandContext context, [NotNull] ManuellDatabaseCommandSettings settings) + public override int Execute([NotNull] CommandContext context, [NotNull] ManuelDatabaseCommandSettings settings) { return settings.IsInteractiv ? GetPathInteractive() : UseSettingPath(settings.GameRootFolder!); } diff --git a/src/IL2CareerToolset/Commands/Cli/Settings/ManuellDatabaseCommandSettings.cs b/src/IL2CareerToolset/Commands/Cli/Settings/ManuelDatabaseCommandSettings.cs similarity index 83% rename from src/IL2CareerToolset/Commands/Cli/Settings/ManuellDatabaseCommandSettings.cs rename to src/IL2CareerToolset/Commands/Cli/Settings/ManuelDatabaseCommandSettings.cs index 49f7f87..5c3482c 100644 --- a/src/IL2CareerToolset/Commands/Cli/Settings/ManuellDatabaseCommandSettings.cs +++ b/src/IL2CareerToolset/Commands/Cli/Settings/ManuelDatabaseCommandSettings.cs @@ -2,7 +2,7 @@ using System.ComponentModel; namespace IL2CareerToolset.Commands.Cli.Settings; -internal class ManuellDatabaseCommandSettings : CommandSettings +internal class ManuelDatabaseCommandSettings : CommandSettings { [CommandArgument(0, "[GameRootFolder]")] [Description("Path to the root folder of the game")] diff --git a/src/IL2CareerToolset/Program.cs b/src/IL2CareerToolset/Program.cs index 48e5db0..8446926 100644 --- a/src/IL2CareerToolset/Program.cs +++ b/src/IL2CareerToolset/Program.cs @@ -35,33 +35,63 @@ public static int Main(params string[] args) { config.AddBranch("settings", settingConfig => { - settingConfig.AddCommand("auto"); - settingConfig.AddCommand("manuell"); - settingConfig.AddCommand("loglevel"); + settingConfig.SetDescription("Commands to find the path to the game or set the log level for the application"); + settingConfig.AddCommand("auto") + .WithExample(new[] {"settings", "auto"}); + settingConfig.AddCommand("manuel") + .WithExample(new[] { "settings", "manuel" }) + .WithExample(new[] {"settings", "manuel", @"path\to\game\root\directory"}); + settingConfig.AddCommand("loglevel") + .WithExample(new[] {"settings", "loglevel", "Information"}); }); config.AddBranch("save", databaseConfig => { + databaseConfig.SetDescription("Commands to manage backups or interact with the game database"); databaseConfig.AddBranch("backup", backupConfig => { - backupConfig.AddCommand("create"); - backupConfig.AddCommand("delete"); - backupConfig.AddCommand("list"); - backupConfig.AddCommand("rename"); - backupConfig.AddCommand("restore"); + backupConfig.SetDescription("Commands to create, delete, list and restore backups of the game database"); + backupConfig.AddCommand("create") + .WithExample(new[] { "save", "backup", "create" }) + .WithExample(new[] {"save", "backup", "create", "\"Backup name\""});; + backupConfig.AddCommand("delete") + .WithExample(new[] { "save", "backup", "delete" }) + .WithExample(new[] { "save", "backup", "delete", "1cdb087d-3d64-47bd-adb1-648f21cf6f69"}) + .WithExample(new[] { "save", "backup", "delete", "--all"}); + backupConfig.AddCommand("list") + .WithExample(new[] { "save", "backup", "list" }); + backupConfig.AddCommand("rename") + .WithExample(new[] { "save", "backup", "rename" }) + .WithExample(new[] { "save", "backup", "rename", "1cdb087d-3d64-47bd-adb1-648f21cf6f69", "\"New name\"" }); + backupConfig.AddCommand("restore") + .WithExample(new[] { "save", "backup", "restore" }) + .WithExample(new[] { "save", "backup", "restore", "1cdb087d-3d64-47bd-adb1-648f21cf6f69" }); }); databaseConfig.AddBranch("game", listConfig => { - listConfig.AddCommand("pilot"); - listConfig.AddCommand("revive"); + listConfig.SetDescription("Commands to list pilots or revive them"); + listConfig.AddCommand("pilot") + .WithExample(new[] { "save", "game", "pilot" }) + .WithExample(new[] { "save", "game", "pilot", "--player" }) + .WithExample(new[] { "save", "game", "pilot", "Pilot name" }) + .WithExample(new[] { "save", "game", "pilot", "Pilot name", "--player" }); + listConfig.AddCommand("revive") + .WithExample(new[] { "save", "game", "revive" }) + .WithExample(new[] { "save", "game", "revive", "--ironman" }); }); }); config.AddBranch("app", repo => { - repo.AddCommand("open"); - repo.AddCommand("issue"); - repo.AddCommand("help"); + repo.SetDescription("Commands for interacting with the application like open the repository, an issues or get some help"); + repo.AddCommand("open") + .WithAlias("repo") + .WithExample(new[] { "app", "open" }); + repo.AddCommand("issue") + .WithAlias("bug") + .WithExample(new[] { "app", "issue" }); + repo.AddCommand("help") + .WithExample(new[] { "app", "help" }); }); }); int returnCode = app.Run(args);