Commit 7b42ba86 authored by Adam Wujek's avatar Adam Wujek

shell: move help cmd to shell.c

This saves 240B
Signed-off-by: 's avatarAdam Wujek <adam.wujek@creotech.pl>
parent 6f13a7f5
/*
* This work is part of the White Rabbit project
*
* Copyright (C) 2012 CERN (www.cern.ch)
* Author: Alessandro Rubini <rubini@gnudd.com>
*
* Released according to the GNU GPL, version 2 or any later version.
*/
#include <stdlib.h>
#include <string.h>
#include <wrc.h>
#include <shell.h>
static int cmd_help(const char *args[])
{
pp_printf("Available commands:\n");
shell_list_cmds();
return 0;
}
DEFINE_WRC_COMMAND(help) = {
.name = "help",
.exec = cmd_help,
};
......@@ -338,16 +338,6 @@ void shell_show_build_init(void)
pp_printf("(empty)\n");
}
void shell_list_cmds()
{
struct wrc_shell_cmd *p;
for (p = __cmd_begin; p < __cmd_end; p++)
{
pp_printf(" %s\n", p->name);
}
}
void shell_activate_ui_command( int (*callback)(void) )
{
shell_ui_callback = callback;
......@@ -356,3 +346,20 @@ void shell_activate_ui_command( int (*callback)(void) )
term_clear();
cmd_len = 0;
}
static int cmd_help(const char *args[])
{
struct wrc_shell_cmd *p;
pp_printf("Available commands:\n");
for (p = __cmd_begin; p < __cmd_end; p++) {
pp_printf(" %s\n", p->name);
}
return 0;
}
DEFINE_WRC_COMMAND(help) = {
.name = "help",
.exec = cmd_help,
};
......@@ -2,7 +2,6 @@ obj-$(CONFIG_WR_NODE) += \
shell/shell.o \
shell/cmd_version.o \
shell/cmd_ptp.o \
shell/cmd_help.o \
shell/cmd_mac.o \
shell/cmd_ps.o \
shell/cmd_uptime.o \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment