[master] 602ff6014 param: Mention aliases in param.show [-j] output

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Tue Mar 8 11:54:08 UTC 2022


commit 602ff6014c6701fe7b1b0cd824bf269b2e117842
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Mar 8 08:56:31 2022 +0100

    param: Mention aliases in param.show [-j] output
    
    Working on the release notes I realized that there was nothing
    actionable to prepare for deprecated aliases in future releases.

diff --git a/bin/varnishd/mgt/mgt_param.c b/bin/varnishd/mgt/mgt_param.c
index 1ea94da54..0aae0c75f 100644
--- a/bin/varnishd/mgt/mgt_param.c
+++ b/bin/varnishd/mgt/mgt_param.c
@@ -248,7 +248,7 @@ static void v_matchproto_(cli_func_t)
 mcf_param_show(struct cli *cli, const char * const *av, void *priv)
 {
 	struct plist *pl;
-	const struct parspec *pp;
+	const struct parspec *pp, *pa;
 	int n, lfmt = 0, chg = 0;
 	struct vsb *vsb;
 	const char *show = NULL;
@@ -316,6 +316,11 @@ mcf_param_show(struct cli *cli, const char * const *av, void *priv)
 		}
 		VCLI_Out(cli, "\n");
 
+		if (lfmt && pp->func == tweak_alias) {
+			pa = TRUST_ME(pp->priv);
+			VCLI_Out(cli, "%-*sAlias of: %s\n",
+			    margin1, " ", pa->name);
+		}
 		if (lfmt && pp->flags & NOT_IMPLEMENTED) {
 			VCLI_Out(cli, "\n");
 			mcf_wrap(cli, NOT_IMPLEMENTED_TEXT);
@@ -373,7 +378,7 @@ mcf_param_show_json(struct cli *cli, const char * const *av, void *priv)
 {
 	int n, comma = 0, chg = 0;
 	struct plist *pl;
-	const struct parspec *pp;
+	const struct parspec *pp, *pa;
 	struct vsb *vsb, *def;
 	const char *show = NULL, *sep;
 
@@ -432,6 +437,10 @@ mcf_param_show_json(struct cli *cli, const char * const *av, void *priv)
 		VCLI_Out(cli, "{\n");
 		VSB_indent(cli->sb, 2);
 		mcf_json_key_valstr(cli, "name", pp->name);
+		if (pp->func == tweak_alias) {
+			pa = TRUST_ME(pp->priv);
+			mcf_json_key_valstr(cli, "alias", pa->name);
+		}
 		if (pp->flags & NOT_IMPLEMENTED) {
 			VCLI_Out(cli, "\"implemented\": false\n");
 			VSB_indent(cli->sb, -2);


More information about the varnish-commit mailing list