I am trying to implement capi cli completion from confd.cli file. In the manual I see that a C file implements the completion point. I am not sure how i could do this without the C file. In out code base everything is done via subscriptions in python files.
You need to look at Python API documentation (found in src/confd/pyapi/doc/confd)
E.g.:
register_action_cbs(...)
register_action_cbs(dx, actionpoint, acb) -> None
This function registers up to five callback functions, two of which will
be called in sequence when an action is invoked.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
actionpoint -- the name of the action point
vcb -- the callback instance (see below)
The acb argument should be an instance of a class with callback methods.
E.g.:
class ActionCallbacks(object):
def cb_init(self, uinfo):
pass
def cb_abort(self, uinfo):
pass
def cb_action(self, uinfo, name, kp, params):
pass
def cb_command(self, uinfo, path, argv):
pass
def cb_completion(self, uinfo, cli_style, token, completion_char,
kp, cmdpath, cmdparam_id, simpleType, extra):
pass
acb = ActionCallbacks()
dp.register_action_cbs(dx, 'actionpoint-1', acb)
Notes about some of the callbacks:
cb_action()
The params argument is a list of _lib.TagValue instances.
cb_command()
The argv argument is a list of strings.
Python documentation and examples are available only for ConfD premium and are part of ConfD packages
(e.g. confd-6.5.2.doc.tar.gz - /doc/api/python , confd-6.5.2.examples.tar.gz - /examples.confd/intro/python).
Not sure what is the problem. Can you check if completionpoint callback is correctly registered? (using confd --status). If yes, are there any hints in confd.log or devel.log?