From 880187857c4385ff914fa89cfaf5764fd1f42d83 Mon Sep 17 00:00:00 2001 From: Mohanad Date: Fri, 11 Oct 2024 00:51:56 +0300 Subject: [PATCH] [#467] Remove deprecated CLI commands --- AUTHORS | 1 + doc/CLI.md | 39 -------- doc/manual/98-acknowledgement.md | 1 + doc/manual/user-10-cli.md | 36 -------- src/cli.c | 150 ------------------------------- 5 files changed, 2 insertions(+), 225 deletions(-) diff --git a/AUTHORS b/AUTHORS index 6bae6f1a..ede2d072 100644 --- a/AUTHORS +++ b/AUTHORS @@ -13,3 +13,4 @@ Henrique de Carvalho Yihe Lu Eugenio Gigante Haoran Zhang +Mohanad Khaled diff --git a/doc/CLI.md b/doc/CLI.md index dd3d630a..fc6854d2 100644 --- a/doc/CLI.md +++ b/doc/CLI.md @@ -343,45 +343,6 @@ pgagroal-cli clear prometheus ``` -## Deprecated commands - -The following commands have been deprecated and will be removed -in later releases of [**pgagroal**](https://github.com/agroal/pgagroal). -For each command, this is the corresponding current mapping -to the working command: - -- `flush-idle` is equivalent to `flush idle`; -- `flush-all` is equivalent to `flush all`; -- `flush-gracefully` is equivalent to `flush gracefully` or simply `flush`; -- `stop` is equivalent to `shutdown immediate`; -- `gracefully` is equivalent to `shutdown gracefully` or simply `shutdown`; -- `reset` is equivalent to `clear prometheus`; -- `reset-server` is equivalent to `clear server` or simply `clear`; -- `config-get` and `config-set` are respectively `conf get` and `conf set`; -- `reload` is equivalent to `conf reload`; -- `is-alive` is equivalent to `ping`; -- `details` is equivalent to `status details`. - - -Whenever you use a deprecated command, the `pgagroal-cli` will print on standard error a warning message. -For example: - -``` -pgagroal-cli reset-server - -WARN: command has been deprecated by since version 1.6.x -``` - -If you don't want to get any warning about deprecated commands, you -can redirect the `stderr` to `/dev/null` or any other location with: - -``` -pgagroal-cli reset-server 2>/dev/null -``` - - - - ## Shell completions There is a minimal shell completion support for `pgagroal-cli`. diff --git a/doc/manual/98-acknowledgement.md b/doc/manual/98-acknowledgement.md index a0dbd34c..2b669435 100644 --- a/doc/manual/98-acknowledgement.md +++ b/doc/manual/98-acknowledgement.md @@ -19,6 +19,7 @@ Ashutosh Sharma Henrique de Carvalho Yihe Lu Eugenio Gigante +Mohanad Khaled ``` ## Committers diff --git a/doc/manual/user-10-cli.md b/doc/manual/user-10-cli.md index ce2e7130..93a15ff1 100644 --- a/doc/manual/user-10-cli.md +++ b/doc/manual/user-10-cli.md @@ -376,42 +376,6 @@ pgagroal-cli clear prometheus ``` -## Deprecated commands - -The following commands have been deprecated and will be removed -in later releases of [**pgagroal**](https://github.com/agroal/pgagroal). -For each command, this is the corresponding current mapping -to the working command: - -- `flush-idle` is equivalent to `flush idle`; -- `flush-all` is equivalent to `flush all`; -- `flush-gracefully` is equivalent to `flush gracefully` or simply `flush`; -- `stop` is equivalent to `shutdown immediate`; -- `gracefully` is equivalent to `shutdown gracefully` or simply `shutdown`; -- `reset` is equivalent to `clear prometheus`; -- `reset-server` is equivalent to `clear server` or simply `clear`; -- `config-get` and `config-set` are respectively `conf get` and `conf set`; -- `reload` is equivalent to `conf reload`; -- `is-alive` is equivalent to `ping`; -- `details` is equivalent to `status details`. - - -Whenever you use a deprecated command, the `pgagroal-cli` will print on standard error a warning message. -For example: - -``` -pgagroal-cli reset-server - -WARN: command has been deprecated by since version 1.6.x -``` - -If you don't want to get any warning about deprecated commands, you -can redirect the `stderr` to `/dev/null` or any other location with: - -``` -pgagroal-cli reset-server 2>/dev/null -``` - ## Shell completions There is a minimal shell completion support for `pgagroal-cli`. diff --git a/src/cli.c b/src/cli.c index 480211f3..e53fe4b2 100644 --- a/src/cli.c +++ b/src/cli.c @@ -265,156 +265,6 @@ const struct pgagroal_command command_table[] = { .deprecated = false, .log_message = "" }, - { - .command = "flush-idle", - .subcommand = "", - .accepted_argument_count = {0, 1}, - .action = ACTION_FLUSH, - .mode = FLUSH_IDLE, - .default_argument = "*", - .deprecated = true, - .deprecated_since_major = 1, - .deprecated_since_minor = 6, - .deprecated_by = "flush idle", - .log_message = " [%s]", - }, - { - .command = "flush-all", - .subcommand = "", - .accepted_argument_count = {0, 1}, - .action = ACTION_FLUSH, - .mode = FLUSH_ALL, - .default_argument = "*", - .deprecated = true, - .deprecated_since_major = 1, - .deprecated_since_minor = 6, - .deprecated_by = "flush all", - .log_message = " [%s]", - }, - { - .command = "flush-gracefully", - .subcommand = "", - .accepted_argument_count = {0, 1}, - .action = ACTION_FLUSH, - .mode = FLUSH_GRACEFULLY, - .default_argument = "*", - .deprecated = true, - .deprecated_since_major = 1, - .deprecated_since_minor = 6, - .deprecated_by = "flush gracefully", - .log_message = " [%s]", - }, - { - .command = "stop", - .subcommand = "", - .accepted_argument_count = {0}, - .action = ACTION_STOP, - .deprecated = true, - .deprecated_since_major = 1, - .deprecated_since_minor = 6, - .deprecated_by = "shutdown immediate", - .log_message = "", - }, - { - .command = "cancel-shutdown", - .subcommand = "", - .accepted_argument_count = {0}, - .action = ACTION_CANCELSHUTDOWN, - .deprecated = true, - .deprecated_since_major = 1, - .deprecated_since_minor = 6, - .deprecated_by = "shutdown cancel", - .log_message = "", - }, - { - .command = "gracefully", - .subcommand = "", - .accepted_argument_count = {0}, - .action = ACTION_GRACEFULLY, - .deprecated = true, - .deprecated_since_major = 1, - .deprecated_since_minor = 6, - .deprecated_by = "shutdown gracefully", - .log_message = "", - }, - { - .command = "details", - .subcommand = "", - .accepted_argument_count = {0}, - .action = ACTION_STATUS_DETAILS, - .deprecated = true, - .deprecated_since_major = 1, - .deprecated_since_minor = 6, - .deprecated_by = "status details", - .log_message = "", - }, - { - .command = "is-alive", - .subcommand = "", - .accepted_argument_count = {0}, - .action = ACTION_ISALIVE, - .deprecated = true, - .deprecated_since_major = 1, - .deprecated_since_minor = 6, - .deprecated_by = "ping", - .log_message = "", - }, - { - .command = "reset", - .subcommand = "", - .accepted_argument_count = {0}, - .action = ACTION_RESET, - .deprecated = true, - .deprecated_since_major = 1, - .deprecated_since_minor = 6, - .deprecated_by = "clear prometheus", - .log_message = "", - }, - { - .command = "reset-server", - .subcommand = "", - .accepted_argument_count = {0, 1}, - .action = ACTION_RESET_SERVER, - .default_argument = "*", - .deprecated = true, - .deprecated_since_major = 1, - .deprecated_since_minor = 6, - .deprecated_by = "clear server", - .log_message = "", - }, - { - .command = "reload", - .subcommand = "", - .accepted_argument_count = {0}, - .action = ACTION_RELOAD, - .deprecated = true, - .deprecated_since_major = 1, - .deprecated_since_minor = 6, - .deprecated_by = "conf reload", - .log_message = "", - }, - { - .command = "config-get", - .subcommand = "", - .accepted_argument_count = {0, 1}, - .action = ACTION_CONFIG_GET, - .deprecated = true, - .deprecated_since_major = 1, - .deprecated_since_minor = 6, - .deprecated_by = "conf get", - .log_message = "", - }, - { - .command = "config-set", - .subcommand = "", - .accepted_argument_count = {2}, - .action = ACTION_CONFIG_SET, - .deprecated = true, - .deprecated_since_major = 1, - .deprecated_since_minor = 6, - .deprecated_by = "conf set", - .log_message = " [%s] = [%s]", - }, }; static void