Skip to content

Commit

Permalink
Merge pull request #34 from XanatosX/develop
Browse files Browse the repository at this point in the history
Release 1.1.1
  • Loading branch information
XanatosX authored Feb 21, 2023
2 parents 6d56537 + 6e2215d commit 8fc72a3
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -362,4 +362,5 @@ MigrationBackup/
# Fody - auto-generated XML schema
FodyWeavers.xsd

launchSettings.json
launchSettings.json
.vscode/**
8 changes: 4 additions & 4 deletions src/IL2CareerToolset/Commands/Cli/ManuelDatabaseCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
namespace IL2CareerToolset.Commands.Cli;

[Description("Command to set the game path by yourself")]
internal class ManuellDatabaseCommand : Command<ManuellDatabaseCommandSettings>
internal class ManuelDatabaseCommand : Command<ManuelDatabaseCommandSettings>
{
private readonly IGamePathValidationService pathValidationService;
private readonly ISettingsService settingsService;
private readonly ILogger<ManuellDatabaseCommand> logger;
private readonly ILogger<ManuelDatabaseCommand> logger;

public ManuellDatabaseCommand(IGamePathValidationService pathValidationService, ISettingsService settingsService, ILogger<ManuellDatabaseCommand> logger)
public ManuelDatabaseCommand(IGamePathValidationService pathValidationService, ISettingsService settingsService, ILogger<ManuelDatabaseCommand> 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!);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
56 changes: 43 additions & 13 deletions src/IL2CareerToolset/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,63 @@ public static int Main(params string[] args)
{
config.AddBranch("settings", settingConfig =>
{
settingConfig.AddCommand<AutomaticallyDetectDatabaseCommand>("auto");
settingConfig.AddCommand<ManuellDatabaseCommand>("manuell");
settingConfig.AddCommand<SetLogLevelCommand>("loglevel");
settingConfig.SetDescription("Commands to find the path to the game or set the log level for the application");
settingConfig.AddCommand<AutomaticallyDetectDatabaseCommand>("auto")
.WithExample(new[] {"settings", "auto"});
settingConfig.AddCommand<ManuelDatabaseCommand>("manuel")
.WithExample(new[] { "settings", "manuel" })
.WithExample(new[] {"settings", "manuel", @"path\to\game\root\directory"});
settingConfig.AddCommand<SetLogLevelCommand>("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<CreateBackupCommand>("create");
backupConfig.AddCommand<DeleteBackupsCommand>("delete");
backupConfig.AddCommand<ListBackupsCommand>("list");
backupConfig.AddCommand<ChangeBackupNameCommand>("rename");
backupConfig.AddCommand<RestoreBackupCommand>("restore");
backupConfig.SetDescription("Commands to create, delete, list and restore backups of the game database");
backupConfig.AddCommand<CreateBackupCommand>("create")
.WithExample(new[] { "save", "backup", "create" })
.WithExample(new[] {"save", "backup", "create", "\"Backup name\""});;
backupConfig.AddCommand<DeleteBackupsCommand>("delete")
.WithExample(new[] { "save", "backup", "delete" })
.WithExample(new[] { "save", "backup", "delete", "1cdb087d-3d64-47bd-adb1-648f21cf6f69"})
.WithExample(new[] { "save", "backup", "delete", "--all"});
backupConfig.AddCommand<ListBackupsCommand>("list")
.WithExample(new[] { "save", "backup", "list" });
backupConfig.AddCommand<ChangeBackupNameCommand>("rename")
.WithExample(new[] { "save", "backup", "rename" })
.WithExample(new[] { "save", "backup", "rename", "1cdb087d-3d64-47bd-adb1-648f21cf6f69", "\"New name\"" });
backupConfig.AddCommand<RestoreBackupCommand>("restore")
.WithExample(new[] { "save", "backup", "restore" })
.WithExample(new[] { "save", "backup", "restore", "1cdb087d-3d64-47bd-adb1-648f21cf6f69" });
});

databaseConfig.AddBranch("game", listConfig =>
{
listConfig.AddCommand<GetPilotsCommand>("pilot");
listConfig.AddCommand<RevivePilotCommand>("revive");
listConfig.SetDescription("Commands to list pilots or revive them");
listConfig.AddCommand<GetPilotsCommand>("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<RevivePilotCommand>("revive")
.WithExample(new[] { "save", "game", "revive" })
.WithExample(new[] { "save", "game", "revive", "--ironman" });
});

});
config.AddBranch("app", repo =>
{
repo.AddCommand<OpenRepositoryCommand>("open");
repo.AddCommand<OpenIssueCommand>("issue");
repo.AddCommand<OpenHelpCommand>("help");
repo.SetDescription("Commands for interacting with the application like open the repository, an issues or get some help");
repo.AddCommand<OpenRepositoryCommand>("open")
.WithAlias("repo")
.WithExample(new[] { "app", "open" });
repo.AddCommand<OpenIssueCommand>("issue")
.WithAlias("bug")
.WithExample(new[] { "app", "issue" });
repo.AddCommand<OpenHelpCommand>("help")
.WithExample(new[] { "app", "help" });
});
});
int returnCode = app.Run(args);
Expand Down

0 comments on commit 8fc72a3

Please sign in to comment.