# How to hide a leaf node in CLI help?

**URL:** <https://dmap-community.ductus.global/t/how-to-hide-a-leaf-node-in-cli-help/749>\
**Category:** YANG\
**Created:** [October 2, 2016, 3:49pm UTC](https://dmap-community.ductus.global/t/how-to-hide-a-leaf-node-in-cli-help/749 "2016-10-02T15:49:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bpalanis](https://avatars.discourse-cdn.com/v4/letter/b/e99b99/32.png) [@bpalanis](https://dmap-community.ductus.global/u/bpalanis)\
**Post date:** [October 2, 2016, 3:49pm UTC](https://dmap-community.ductus.global/t/how-to-hide-a-leaf-node-in-cli-help/749/1 "2016-10-02T15:49:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jjohansson](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@jjohansson](https://dmap-community.ductus.global/u/jjohansson)\
**Post date:** [October 4, 2016, 11:19pm UTC](https://dmap-community.ductus.global/t/how-to-hide-a-leaf-node-in-cli-help/749/2 "2016-10-04T23:19:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bpalanis](https://avatars.discourse-cdn.com/v4/letter/b/e99b99/32.png) [@bpalanis](https://dmap-community.ductus.global/u/bpalanis)\
**Post date:** [October 5, 2016, 4:43pm UTC](https://dmap-community.ductus.global/t/how-to-hide-a-leaf-node-in-cli-help/749/3 "2016-10-05T16:43:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [October 6, 2016, 3:41am UTC](https://dmap-community.ductus.global/t/how-to-hide-a-leaf-node-in-cli-help/749/4 "2016-10-06T03:41:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eyaoxig](https://avatars.discourse-cdn.com/v4/letter/e/d07c76/32.png) [@eyaoxig](https://dmap-community.ductus.global/u/eyaoxig)\
**Post date:** [August 8, 2018, 9:13am UTC](https://dmap-community.ductus.global/t/how-to-hide-a-leaf-node-in-cli-help/749/5 "2018-08-08T09:13:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [August 10, 2018, 10:32am UTC](https://dmap-community.ductus.global/t/how-to-hide-a-leaf-node-in-cli-help/749/6 "2018-08-10T10:32:09Z")

</div>

Hi Xiangping,

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

```xml
    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:

```java
# 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

---

<div class="post-metadata">

**Author:** ![eyaoxig](https://avatars.discourse-cdn.com/v4/letter/e/d07c76/32.png) [@eyaoxig](https://dmap-community.ductus.global/u/eyaoxig)\
**Post date:** [August 20, 2018, 3:17am UTC](https://dmap-community.ductus.global/t/how-to-hide-a-leaf-node-in-cli-help/749/7 "2018-08-20T03:17:33Z")

</div>

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
