Zephyr Scientific Library (zscilib)
shell.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2021 Kevin Townsend (KTOWN)
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <stdlib.h>
8 #include <ctype.h>
9 #include <zephyr/shell/shell.h>
10 #include <zsl/zsl.h>
11 
12 #if CONFIG_ZSL_SHELL
13 
14 static int
15 zsl_shell_cmd_version(const struct shell *shell, size_t argc, char **argv)
16 {
17  ARG_UNUSED(argc);
18  ARG_UNUSED(argv);
19 
20  shell_print(shell, "%s", zsl_version);
21 
22  return 0;
23 }
24 
25 /* Subcommand array for "zsl" (level 1). */
26 SHELL_STATIC_SUBCMD_SET_CREATE(
27  sub_zsl,
28  /* 'version' command handler. */
29  SHELL_CMD(version, NULL, "library version", zsl_shell_cmd_version),
30 
31  /* Array terminator. */
32  SHELL_SUBCMD_SET_END
33  );
34 
35 /* Root command "zsl" (level 0). */
36 SHELL_CMD_REGISTER(zsl, &sub_zsl, "zscilib commands", NULL);
37 
38 #endif
zsl_version
const char * zsl_version
Definition: zsl.c:9
zsl.h
API header file for zscilib.