ConfD User Community

How to hide a leaf node in CLI help?


#1

Hi,

We have the following container:

container test {
leaf val1;
leaf val2;
leaf val3;
};

All leaf nodes are configurable.
For test container CLI help shall show all 3 leaf nodes.
and in show command all three nodes are displaying.

My requirement is, in CLI help I want to hide val3 alone.
So in CLI help only val1 and val2 should be shown.
But val3 should be allowed for config and should show in CLI show output.

Is there anyway to do this?

Thanks in advance!

Regards,
Bala


#2

I’m a bit confused…

First you say “For test container CLI help shall show all 3 leaf nodes.” and then “So in CLI help only val1 and val2 should be shown.”.

A sequence of CLI commands and their desired output would be helpful.


#3
  1. In set command when we give tab, it list all possible leaf nodes.
  2. In show command will show all leaf nodes which is set with value.

My requirement is in (1) want to hide val3 when we give tab key.
But the same val3 should be allowed for set and show.


#4

Hi,
See for example “tailf:cli-suppress-show-match" extension in the tailf_yang_cli_extensions man page.


#5

Hi Conny,

I tried “tailf:cli-suppress-show-match" but it doesn’t work.
/* dhcpd.yang /
container test-c {
leaf t-val1 {
type string;
}
leaf t-val2 {
type string;
}
leaf t-val3 {
tailf:cli-suppress-show-match;
type string;
}
}
/
confd-cli */
selnipnnx1002(config)# dhcp test-c ?
Possible completions:
t-val1 t-val2 t-val3  -> leaf t-val3 is still displayed when user inputs ‘?’ or TAB
selnipnnx1002(config)# dhcp test-c

In Ericsson ECIM model definition, we have tag “preliminary”, if one attribute is marked as “preliminary”, the behavior is:

  1. if user inputs “?” or “TAB”, this attribute will not be displayed as possible completions.
  2. user can configure it, and after the attribute is configured, the attribute can be displayed.

Can “tailf:cli-suppress-show-match" support above behavior? Or any other extension can be used? Thanks.

Regards,
Xiangping


#6

Hi Xiangping,

Take this YANG model from the ConfD example examples.confd/cli/climods

    container arp3 {
        config false;
        tailf:callpoint jarp_data;
        list arpe {
            key "ip ifname";
            max-elements 1024;
            leaf ip {
                type inet:ip-address;
            }
            leaf ifname {
                type string;
            }
            leaf hwaddr {
                tailf:cli-suppress-show-path;
                type string;
                mandatory true;
            }
            leaf permanent {
                tailf:cli-suppress-show-match;
                type boolean;
                mandatory true;
            }
            leaf published {
                type boolean;
                mandatory true;
            }
        }
    }

CLI:

# show arp3 arpe <TAB PRESSED>
Possible completions:
  10.0.0.1  10.0.0.2  192.168.0.2  |  <cr>
Possible match completions:
  published

Only the “published” leaf is shown as “Possible match completions” since the “tailf:cli-suppress-show-match” and “tailf:cli-suppress-show-path” extensions are used with the “hwaddr” and “permanent” leafs.

You describe your use case as being more advanced, and so I believe you need to use for example the clispec completionpoint. See ConfD UG 16.13.1. Customizing CLI completion and examples.confd/cli/completions for more details.

Regards


#7

Hi Conny,

Thanks for your answer. Then it looks like “tailf:cli-suppress-show-match” is used for “Possible match completions”, not for “Possible completions”.
As for “Customizing CLI completion”, I will check it. Thanks.

Regards,
Xiangping