hide the deprecated -ssl options from completion

This commit is contained in:
ailin-nemui 2020-04-05 21:22:19 +02:00
commit 485ed2f52b
4 changed files with 51 additions and 16 deletions

View file

@ -544,7 +544,11 @@ static GList *completion_get_options(const char *cmd, const char *option)
list = NULL;
len = strlen(option);
for (tmp = rec->options; *tmp != NULL; tmp++) {
const char *optname = *tmp + iscmdtype(**tmp);
const char *optname;
if (**tmp == '~')
continue; /* deprecated or hidden option */
optname = *tmp + iscmdtype(**tmp);
if (len == 0 || g_ascii_strncasecmp(optname, option, len) == 0)
list = g_list_append(list, g_strconcat("-", optname, NULL));

View file

@ -453,8 +453,19 @@ void fe_server_init(void)
command_bind_first("server", NULL, (SIGNAL_FUNC) server_command);
command_bind_first("disconnect", NULL, (SIGNAL_FUNC) server_command);
command_set_options("server add", "4 6 !! ssl nossl +ssl_cert +ssl_pkey +ssl_pass ssl_verify nossl_verify +ssl_cafile +ssl_capath +ssl_ciphers +ssl_fingerprint tls notls +tls_cert +tls_pkey +tls_pass tls_verify notls_verify +tls_cafile +tls_capath +tls_ciphers +tls_pinned_cert +tls_pinned_pubkey auto noauto proxy noproxy -host -port noautosendcmd");
command_set_options("server modify", "4 6 !! ssl nossl +ssl_cert +ssl_pkey +ssl_pass ssl_verify nossl_verify +ssl_cafile +ssl_capath +ssl_ciphers +ssl_fingerprint tls notls +tls_cert +tls_pkey +tls_pass tls_verify notls_verify +tls_cafile +tls_capath +tls_ciphers +tls_pinned_cert +tls_pinned_pubkey auto noauto proxy noproxy -host -port noautosendcmd");
command_set_options(
"server add", "4 6 !! ~ssl ~nossl ~+ssl_cert ~+ssl_pkey ~+ssl_pass ~ssl_verify "
"~nossl_verify ~+ssl_cafile ~+ssl_capath ~+ssl_ciphers ~+ssl_fingerprint "
"tls notls +tls_cert +tls_pkey +tls_pass tls_verify notls_verify "
"+tls_cafile +tls_capath +tls_ciphers +tls_pinned_cert "
"+tls_pinned_pubkey auto noauto proxy noproxy -host -port noautosendcmd");
command_set_options(
"server modify",
"4 6 !! ~ssl ~nossl ~+ssl_cert ~+ssl_pkey ~+ssl_pass ~ssl_verify ~nossl_verify "
"~+ssl_cafile ~+ssl_capath ~+ssl_ciphers ~+ssl_fingerprint tls notls +tls_cert "
"+tls_pkey +tls_pass tls_verify notls_verify +tls_cafile +tls_capath +tls_ciphers "
"+tls_pinned_cert +tls_pinned_pubkey auto noauto proxy noproxy -host -port "
"noautosendcmd");
signal_add("server looking", (SIGNAL_FUNC) sig_server_looking);
signal_add("server connecting", (SIGNAL_FUNC) sig_server_connecting);