1 ;;; cli-cmd-skel.el - cli command skeleton
5 (define-skeleton skel-cli-cmd
6 "Insert a CLI command "
8 '(setq cmd-name (skeleton-read "Command Name: "))
9 '(setq path (skeleton-read "Path: "))
13 " cmd-name "_command_fn (vlib_main_t * vm,
14 unformat_input_t * input,
15 vlib_cli_command_t * cmd)
17 while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) {
18 if (unformat (input, \"whatever %d\", &whatever))
21 return clib_error_return (0, \"unknown input `%U'\",
22 format_unformat_error, input);
27 VLIB_CLI_COMMAND (" cmd-name "_command, static) = {
29 .short_help = \"" path "\",
30 .function = " cmd-name "_command_fn,