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?
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
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
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]: