summaryrefslogtreecommitdiff
path: root/avr/command_tbl.c
blob: c0579bc29f72eed607b7ac2d700ae456ac63a355 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "common.h"

#include "command.h"



extern int do_help(cmd_tbl_t *, int, int, char * const []);
extern int do_echo(cmd_tbl_t *, int, int, char * const []);
extern int do_env_print(cmd_tbl_t *, int, int, char * const []);
extern int do_env_set(cmd_tbl_t *, int, int, char * const []);


cmd_tbl_t cmd_tbl[] = {

CMD_TBL_ITEM(
	echo,	CONFIG_SYS_MAXARGS,	1,	do_echo,
	"echo args to console",
	"[args..]\n"
	"     - echo args to console; \\c suppresses newline"
),
CMD_TBL_ITEM_COMPLETE(
	run,	CONFIG_SYS_MAXARGS,	1,	do_run,
	"run commands in an environment variable",
	"var [...]\n"
	"    - run the commands in the environment variable(s) 'var'",
	var_complete
),
CMD_TBL_ITEM_COMPLETE(
	printenv, CONFIG_SYS_MAXARGS,	1,	do_env_print,
	"print environment variables",
	"\n    - print [all] values of all environment variables\n"
	"printenv name ...\n"
	"    - print value of environment variable 'name'",
	var_complete
),
CMD_TBL_ITEM_COMPLETE(
	setenv, CONFIG_SYS_MAXARGS,	0,	do_env_set,
	"set environment variables",
	"[-f] name value ...\n"
	"    - [forcibly] set environment variable 'name' to 'value ...'\n"
	"setenv [-f] name\n"
	"    - [forcibly] delete environment variable 'name'",
	var_complete
),
CMD_TBL_ITEM(
	help,	CONFIG_SYS_MAXARGS,	1,	do_help,
	"print command description/usage",
	"\n"
	"       - print brief description of all commands\n"
	"help command ...\n"
	"       - print detailed usage of 'command'"
),

/* This does not use the U_BOOT_CMD macro as ? can't be used in symbol names */
	{FSTR("?"),   CONFIG_SYS_MAXARGS, 1, do_help,
	 FSTR("alias for 'help'"),
#ifdef  CONFIG_SYS_LONGHELP
	FSTR(""),
#endif /* CONFIG_SYS_LONGHELP */
#ifdef CONFIG_AUTO_COMPLETE
	0,
#endif
},
/* Mark end of table */
{ 0 },
};