-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecated pgagroal-cli
commands config-get
and config-set
do not work as expected
#410
Comments
@decarv Can you work on this ? |
Sure! I plan to open a PR soon that should close #403 and this issue. But this issue should be a quick fix and thus quicker to review. I will work on it. |
See if it worth to split the patch into the separate issue. Otherwise, just reference both issues in the commit message |
This commit improves the error messages for pgagroal-cli and pgagroal-admin commands by modifying the parse_command function. The parsing step now involves two tables (command_table) defined in each cli.c and admin.c files, which guide the parsing of commands. Now adding a command with the structure "<command> [subcommand] [arg] [arg] ..." requires the addition of the command enum and its struct in the command_table.
This commit improves the error messages for pgagroal-cli and pgagroal-admin commands by modifying the parse_command function. The parsing step now involves two tables (command_table) defined in each cli.c and admin.c files, which guide the parsing of commands. Now adding a command with the structure "<command> [subcommand] [arg] [arg] ..." requires the addition of the command enum and its struct in the command_table.
@jesperpedersen Splitting the patch was impractical. I just referenced both issues. |
That is quite ok |
This commit improves the error messages for pgagroal-cli and pgagroal-admin commands by modifying the parse_command function. The parsing step now involves two tables (command_table) defined in each cli.c and admin.c files, which guide the parsing of commands. Now adding a command with the structure "<command> [subcommand] [arg] [arg] ..." requires the addition of the command enum and its struct in the command_table.
This commit improves the error messages for pgagroal-cli and pgagroal-admin commands by modifying the parse_command function. The parsing step now involves two tables (command_table) defined in each cli.c and admin.c files, which guide the parsing of commands. Now adding a command with the structure "<command> [subcommand] [arg] [arg] ..." requires the addition of the command enum and its struct in the command_table.
This commit improves the error messages for pgagroal-cli and pgagroal-admin commands by modifying the parse_command function. The parsing step now involves two tables (command_table) defined in each cli.c and admin.c files, which guide the parsing of commands. Now adding a command with the structure "<command> [subcommand] [arg] [arg] ..." requires the addition of the command enum and its struct in the command_table.
This commit improves the error messages for pgagroal-cli and pgagroal-admin commands by modifying the `parse_command` function. `parse_command` now involves the interpretation of a `command_table` of `struct pgagroal_command`, defined in each cli.c and admin.c files. The `struct pgagroal_command` holds, beyond other things, the command, the subcommand and the accepted count of arguments. With this information, `parse_command` is now able to display error messages when (a) the typed command is invalid, (b) the typed command requires a subcommand, (c) the typed subcommand is invalid, or when, (d) for the typed command, there are too few or too many arguments. Now adding a command with the same invoking structure as the others (i.e., "<command> [subcommand] [arg] [arg] ...") requires inserting an entry in the `command_table` by filling the `struct pgagroal_command`.
This commit improves the error messages for pgagroal-cli and pgagroal-admin commands by modifying the `parse_command` function. `parse_command` now involves the interpretation of a `command_table` of `struct pgagroal_command`, defined in each cli.c and admin.c files. The `struct pgagroal_command` holds, beyond other things, the command, the subcommand and the accepted count of arguments. With this information, `parse_command` is now able to display error messages when (a) the typed command is invalid, (b) the typed command requires a subcommand, (c) the typed subcommand is invalid, or when, (d) for the typed command, there are too few or too many arguments. Now adding a command with the same invoking structure as the others (i.e., "<command> [subcommand] [arg] [arg] ...") requires inserting an entry in the `command_table` by filling the `struct pgagroal_command`.
Close via 11a1f47 |
Describe the bug
Deprecated
pgagroal-cli
commands should still execute the corresponding new commands, but this is not true forconfig-get
andconfig-set
.To Reproduce
Run in the terminal the commands and get the error message
unknown command config-get
.Version
pgagroal-cli 1.7.0
Diagnosis
Neither
config_key
orconfig_value
are ever passed toparse_deprecated_command
, thus being impossible to parse these values. This function needs to be modified.The text was updated successfully, but these errors were encountered: