view toys/other/help.c @ 1101:ccf4193167c3 draft

Make the patch -x option (only enabled with CONFIG_DEBUG) provide more information about why a patch didn't apply. (Offset of first nonmatching character at each line during seek phase.)
author Rob Landley <rob@landley.net>
date Thu, 31 Oct 2013 09:36:55 -0500
parents 34ac05521d94
children 4654f241ccbe
line wrap: on
line source

/* help.c - Show help for toybox commands
 *
 * Copyright 2007 Rob Landley <rob@landley.net>
 *
 * Often a shell builtin.

USE_HELP(NEWTOY(help, "<1", TOYFLAG_BIN))

config HELP
  bool "help"
  default y
  depends on TOYBOX_HELP
  help
    usage: help [command]

    Show usage information for toybox commands.
    Run "toybox" with no arguments for a list of available commands.
*/


#include "toys.h"

void help_main(void)
{
  struct toy_list *t = toy_find(*toys.optargs);

  if (!t) error_exit("Unknown command '%s'", *toys.optargs);
  toys.which = t;
  show_help();
}