shell_commands: provide command to print version
This commit is contained in:
parent
c7f29c2ea4
commit
5fd88ab44a
@ -18,6 +18,8 @@
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "periph/pm.h"
|
||||
|
||||
int _reboot_handler(int argc, char **argv)
|
||||
@ -29,3 +31,13 @@ int _reboot_handler(int argc, char **argv)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int _version_handler(int argc, char **argv)
|
||||
{
|
||||
(void) argc;
|
||||
(void) argv;
|
||||
|
||||
puts(RIOT_VERSION);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
#include "shell_commands.h"
|
||||
|
||||
extern int _reboot_handler(int argc, char **argv);
|
||||
extern int _version_handler(int argc, char **argv);
|
||||
|
||||
#ifdef MODULE_CONFIG
|
||||
extern int _id_handler(int argc, char **argv);
|
||||
@ -172,6 +173,7 @@ extern int _suit_handler(int argc, char **argv);
|
||||
|
||||
const shell_command_t _shell_command_list[] = {
|
||||
{"reboot", "Reboot the node", _reboot_handler},
|
||||
{"version", "Prints current RIOT_VERSION", _version_handler},
|
||||
#ifdef MODULE_CONFIG
|
||||
{"id", "Gets or sets the node's id.", _id_handler},
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user