Skip to content

Commit

Permalink
[agroal#467] Remove deprecated CLI commands
Browse files Browse the repository at this point in the history
  • Loading branch information
MohanadKh03 committed Oct 10, 2024
1 parent 3c6a410 commit 8801878
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 225 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Henrique de Carvalho <decarv.henrique@gmail.com>
Yihe Lu <t1t4m1un@gmail.com>
Eugenio Gigante <giganteeugenio2@gmail.com>
Haoran Zhang <andrewzhr9911@gmail.com>
Mohanad Khaled <mohanadkhaled87@gmail.com>
39 changes: 0 additions & 39 deletions doc/CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <reset-server> has been deprecated by <clear server> 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`.
Expand Down
1 change: 1 addition & 0 deletions doc/manual/98-acknowledgement.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Ashutosh Sharma <ash2003sharma@gmail.com>
Henrique de Carvalho <decarv.henrique@gmail.com>
Yihe Lu <t1t4m1un@gmail.com>
Eugenio Gigante <giganteeugenio2@gmail.com>
Mohanad Khaled <mohanadkhaled87@gmail.com>
```

## Committers
Expand Down
36 changes: 0 additions & 36 deletions doc/manual/user-10-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <reset-server> has been deprecated by <clear server> 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`.
Expand Down
150 changes: 0 additions & 150 deletions src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,156 +265,6 @@ const struct pgagroal_command command_table[] = {
.deprecated = false,
.log_message = "<status details>"
},
{
.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 = "<flush idle> [%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 = "<flush all> [%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 = "<flush gracefully> [%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 = "<shutdown immediate>",
},
{
.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 = "<shutdown cancel>",
},
{
.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 = "<shutdown gracefully>",
},
{
.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 = "<status details>",
},
{
.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 = "<ping>",
},
{
.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 = "<clear prometheus>",
},
{
.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 = "<clear server [%s]>",
},
{
.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 = "<conf reload>",
},
{
.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 = "<conf get [%s]>",
},
{
.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 = "<conf set> [%s] = [%s]",
},
};

static void
Expand Down

0 comments on commit 8801878

Please sign in to comment.