Commit 602ff601 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

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.
parent 8ee09eb9
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment