From 22b44e4a85d2c46ba705dc428838ac90e8ba8d4e Mon Sep 17 00:00:00 2001 From: database64128 Date: Thu, 23 Jan 2025 17:15:03 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20System.CommandLine=20breaking=20?= =?UTF-8?q?changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CubicBot.Telegram.Tool.csproj | 2 +- CubicBot.Telegram.Tool/Program.cs | 44 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/CubicBot.Telegram.Tool/CubicBot.Telegram.Tool.csproj b/CubicBot.Telegram.Tool/CubicBot.Telegram.Tool.csproj index a331c11..77de6ed 100644 --- a/CubicBot.Telegram.Tool/CubicBot.Telegram.Tool.csproj +++ b/CubicBot.Telegram.Tool/CubicBot.Telegram.Tool.csproj @@ -5,7 +5,7 @@ - + diff --git a/CubicBot.Telegram.Tool/Program.cs b/CubicBot.Telegram.Tool/Program.cs index 17667f9..7e34239 100644 --- a/CubicBot.Telegram.Tool/Program.cs +++ b/CubicBot.Telegram.Tool/Program.cs @@ -2,84 +2,84 @@ using System.Text; using CubicBot.Telegram.Tool.CLI; -var botTokenOption = new CliOption("--bot-token") +var botTokenOption = new Option("--bot-token") { Description = "Telegram bot token.", }; -var enableCommandsModuleOption = new CliOption("--enable-commands-mod") +var enableCommandsModuleOption = new Option("--enable-commands-mod") { Description = "Whether to enable the commands module.", }; -var enableStatsModuleOption = new CliOption("--enable-stats-mod") +var enableStatsModuleOption = new Option("--enable-stats-mod") { Description = "Whether to enable the stats module.", }; -var enablePersonalCommandsOption = new CliOption("--enable-personal-commands") +var enablePersonalCommandsOption = new Option("--enable-personal-commands") { Description = "Whether to enable personal commands.", }; -var enableCommonCommandsOption = new CliOption("--enable-common-commands") +var enableCommonCommandsOption = new Option("--enable-common-commands") { Description = "Whether to enable common commands.", }; -var enableDiceCommandsOption = new CliOption("--enable-dice-commands") +var enableDiceCommandsOption = new Option("--enable-dice-commands") { Description = "Whether to enable dice commands.", }; -var enableConsentNotNeededCommandsOption = new CliOption("--enable-consent-not-needed-commands") +var enableConsentNotNeededCommandsOption = new Option("--enable-consent-not-needed-commands") { Description = "Whether to enable consent not needed commands.", }; -var enableNonVeganCommandsOption = new CliOption("--enable-non-vegan-commands") +var enableNonVeganCommandsOption = new Option("--enable-non-vegan-commands") { Description = "Whether to enable non-vegan commands.", }; -var enableLawEnforcementCommandsOption = new CliOption("--enable-law-enforcement-commands") +var enableLawEnforcementCommandsOption = new Option("--enable-law-enforcement-commands") { Description = "Whether to enable law enforcement commands.", }; -var enablePublicServicesCommandsOption = new CliOption("--enable-public-services-commands") +var enablePublicServicesCommandsOption = new Option("--enable-public-services-commands") { Description = "Whether to enable public services commands.", }; -var enableChineseCommandsOption = new CliOption("--enable-chinese-commands") +var enableChineseCommandsOption = new Option("--enable-chinese-commands") { Description = "Whether to enable Chinese commands.", }; -var enableChineseTasksCommandsOption = new CliOption("--enable-chinese-tasks-commands") +var enableChineseTasksCommandsOption = new Option("--enable-chinese-tasks-commands") { Description = "Whether to enable Chinese tasks commands.", }; -var enableSystemdCommandsOption = new CliOption("--enable-systemd-commands") +var enableSystemdCommandsOption = new Option("--enable-systemd-commands") { Description = "Whether to enable systemd commands.", }; -var enableGrassStatsOption = new CliOption("--enable-grass-stats") +var enableGrassStatsOption = new Option("--enable-grass-stats") { Description = "Whether to enable grass stats.", }; -var enableCommandStatsOption = new CliOption("--enable-command-stats") +var enableCommandStatsOption = new Option("--enable-command-stats") { Description = "Whether to enable command stats.", }; -var enableMessageCounterOption = new CliOption("--enable-message-counter") +var enableMessageCounterOption = new Option("--enable-message-counter") { Description = "Whether to enable message counter.", }; -var enableTwoTripleThreeOption = new CliOption("--enable-two-triple-three") +var enableTwoTripleThreeOption = new Option("--enable-two-triple-three") { Description = "Whether to enable two triple three (2333) counter.", }; -var enableParenthesisEnclosureOption = new CliOption("--enable-parenthesis-enclosure") +var enableParenthesisEnclosureOption = new Option("--enable-parenthesis-enclosure") { Description = "Whether to enable parenthesis enclosure.", }; -var configGetCommand = new CliCommand("get", "Print config."); +var configGetCommand = new Command("get", "Print config."); -var configSetCommand = new CliCommand("set", "Change config.") +var configSetCommand = new Command("set", "Change config.") { botTokenOption, enableCommandsModuleOption, @@ -143,13 +143,13 @@ cancellationToken); }); -var configCommand = new CliCommand("config", "Print or change config.") +var configCommand = new Command("config", "Print or change config.") { configGetCommand, configSetCommand, }; -var rootCommand = new CliRootCommand("A stupid and annoying chatbot for your group chats.") +var rootCommand = new RootCommand("A stupid and annoying chatbot for your group chats.") { configCommand, };