# Tailf:cli-completion-actionpoint callback not getting invoked when pressed "enter" in action command

**URL:** https://dmap-community.ductus.global/t/tailf-cli-completion-actionpoint-callback-not-getting-invoked-when-pressed-enter-in-action-command/4326
**Category:** YANG
**Created:** [January 24, 2023, 3:56pm UTC](https://dmap-community.ductus.global/t/tailf-cli-completion-actionpoint-callback-not-getting-invoked-when-pressed-enter-in-action-command/4326 "2023-01-24T15:56:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kboyapa1](https://avatars.discourse-cdn.com/v4/letter/k/e0b2c6/32.png) [@kboyapa1](https://dmap-community.ductus.global/u/kboyapa1)
#### Post date: [January 24, 2023, 3:56pm UTC](https://dmap-community.ductus.global/t/tailf-cli-completion-actionpoint-callback-not-getting-invoked-when-pressed-enter-in-action-command/4326/1 "2023-01-24T15:56:00Z")

</div>

I’m implementing a `tailf:cli-completion-actionpoint` callback to customise the possible completion leaf values as **action** input. The cli-completion-actionpoint callback, implemented in application code, is getting invoked correctly and displaying the possible completion values as expected when given “?” or “”. But the callback is not getting invoked when pressed “enter” () and its displaying all enum values as possible completion.

I registered the same `tailf:cli-completion-actionpoint` callback for a config command (as shown in the below schema prototype). The callback is getting invoked correctly when given “enter” or “?” or “” for possible completion and displaying the values provided by `confd_action_reply_completion()` in the application code.

The expected possible completion values in the below example are `prime256v1` and `secp384r1`.

How to display the correct possible values in case of action command when pressed “enter” for possible completion?

```auto
    typedef curve-types {
        type enumeration {
            enum secp160k1 { value 4; }
            enum secp384r1 { value 11; }
            enum prime192v1 { value 13; }
        }
    }

    grouping koti-curve {
        leaf curve {
            type curve-types;
            tailf:cli-completion-actionpoint tls-type-completion {
                 tailf:cli-completion-id "tls-curve-name";
            }
        }
    }

    container koti {
        container config {
            uses koti-curve;
        }

        tailf:action koti-action {
            tailf:actionpoint tls-action;
            tailf:cli-configure-mode;

            input {
                uses koti-curve;
            }
        }
    }

```

# Output of cli-completion-actionpoint in action command

```auto
appliance-1(config)# koti 
Possible completions:
  config koti-action
appliance-1(config)# 
appliance-1(config)# koti koti-action ?
Possible completions:
  curve <cr>
appliance-1(config)# koti koti-action curve ?
Possible completions:
  prime256v1 X9.62/SECG curve over a 256 bit prime field
  secp384r1 NIST/SECG curve over a 384 bit prime field
appliance-1(config)# koti koti-action curve <cr>
Value for 'curve' [prime192v1,secp160k1,secp384r1]: k
The value must be one of:
  prime192v1 secp160k1 secp384r1
Value for 'curve' [prime192v1,secp160k1,secp384r1]:
Aborted: by user
appliance-1(config)# koti koti-action curve <TAB>
Possible completions:
  prime256v1 X9.62/SECG curve over a 256 bit prime field
  secp384r1 NIST/SECG curve over a 384 bit prime field
appliance-1(config)# koti koti-action curve 

```

# Output of cli-completion-actionpoint in config command

```auto
appliance-1(config)# koti ?                 
Possible completions:
  config koti-action
appliance-1(config)# koti config curve ?
Possible completions:
  prime256v1 X9.62/SECG curve over a 256 bit prime field
  secp384r1 NIST/SECG curve over a 384 bit prime field
appliance-1(config)# koti config curve <TAB>
Possible completions:
  prime256v1 X9.62/SECG curve over a 256 bit prime field
  secp384r1 NIST/SECG curve over a 384 bit prime field
appliance-1(config)# koti config curve <cr>
[prime256v1,secp384r1]: 

```

---

<div class="post-metadata">

### Author: ![mvf](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/mvf/32/182_2.png) [@mvf](https://dmap-community.ductus.global/u/mvf)
#### Post date: [January 25, 2023, 10:00am UTC](https://dmap-community.ductus.global/t/tailf-cli-completion-actionpoint-callback-not-getting-invoked-when-pressed-enter-in-action-command/4326/2 "2023-01-25T10:00:36Z")

</div>

I am afraid the custom completion works only in the basic command line, not in the value prompt.

---

<div class="post-metadata">

### Author: ![kboyapa1](https://avatars.discourse-cdn.com/v4/letter/k/e0b2c6/32.png) [@kboyapa1](https://dmap-community.ductus.global/u/kboyapa1)
#### Post date: [January 25, 2023, 3:57pm UTC](https://dmap-community.ductus.global/t/tailf-cli-completion-actionpoint-callback-not-getting-invoked-when-pressed-enter-in-action-command/4326/3 "2023-01-25T15:57:53Z")

</div>

The custom completion is working correctly (callback is invoking) for value prompt when the command is a configuration. It’s not working for tailf:action commands.

Is there any other possible options, either in the schema or application code, to provide the custom possible completion values for a leaf in tailf:action commands?

---

<div class="post-metadata">

### Author: ![mvf](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/mvf/32/182_2.png) [@mvf](https://dmap-community.ductus.global/u/mvf)
#### Post date: [January 26, 2023, 10:58am UTC](https://dmap-community.ductus.global/t/tailf-cli-completion-actionpoint-callback-not-getting-invoked-when-pressed-enter-in-action-command/4326/5 "2023-01-26T10:58:25Z")

</div>

Oh, I understand now. No, I’m afraid this is a glitch in how ConfD handles completion in action input leafs.
