diff options
author | Jere Leppänen <jere.leppanen@nokia.com> | 2021-04-24 10:20:19 +0300 |
---|---|---|
committer | Petri Savolainen <petri.savolainen@nokia.com> | 2021-06-01 14:56:01 +0300 |
commit | 7f30069dd48d38f7069118cc926ae33526cb201e (patch) | |
tree | 612925c6009202c1cd7005f8f1cec0d4385519fd /helper/test | |
parent | 4df98a11a2059ad818d0e56d162dffa852d12946 (diff) |
helper: cli: add user command functions
Allow user to register CLI commands with a name, function, and an
optional help text.
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Diffstat (limited to 'helper/test')
-rw-r--r-- | helper/test/cli.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/helper/test/cli.c b/helper/test/cli.c index ff3ea2f53..e7ed0e06f 100644 --- a/helper/test/cli.c +++ b/helper/test/cli.c @@ -38,7 +38,12 @@ int main(int argc, char *argv[]) odph_cli_param_init(&cli_param); - if (odph_cli_start(instance, &cli_param)) { + if (odph_cli_init(instance, &cli_param)) { + ODPH_ERR("Error: odph_cli_init() failed.\n"); + exit(EXIT_FAILURE); + } + + if (odph_cli_start()) { ODPH_ERR("Error: odph_cli_start() failed.\n"); exit(EXIT_FAILURE); } @@ -48,6 +53,11 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } + if (odph_cli_term()) { + ODPH_ERR("Error: odph_cli_term() failed.\n"); + exit(EXIT_FAILURE); + } + if (odp_term_local()) { ODPH_ERR("Error: ODP local term failed.\n"); exit(EXIT_FAILURE); |