Skip to main content

Extending SEF CLI

SEF-CLI was created with extensibility and improvement in mind; its functionality may be easily extended by adding new targets and by adding new actions to existing targets. Similarly, the functionality of existing actions may be easily updated or augmented. A good use case for the extensibility of SEF-CLI is configuring custom code without the need for creating a separate app. For example, SEF-CLI has been extended by adding an ftl target to interact with the reference FTL module. In the same way, SEF-CLI may be extended to interact with user-defined targets.

To get started, begin by examining the existing targets. The targets are located in the engines directory. Moreover, an example null target engines/null.c has been added, which can be used as a model or template for building another desired custom target.

DevTools

The devtool directory includes development-only code to generate the man page and the autocomplete script. After making any changes to SEF-CLI, these tools may be used to generate a new man page and auto-complete script. In order to use the DevTools, the DEVTOOL macro should be defined. CMake option sef_cli_enable_devtool will define the DEVTOOL macro and enable use of the DevTools.

The following commands enable the DevTools while building sef-cli and shows how to generate the man page and the auto-complete script.

$ cd <path to SEF_SDK>/cli
$ cmake -Dsef_enable_devtool=ON ..
$ make
$ ./sef-cli --man-page -V > ../sef-cli.1


$ ./sef-cli --auto-complete > ../sef-cli_completion.sh