cmd_help.c 561 Bytes
Newer Older
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
/*
 * 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[])
{
	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,
};