view toys/other/help.c @ 858:34ac05521d94

Move guts of help command into show_help() in lib/help.c, with config TOYBOX_HELP controlling infrastructure.
author Rob Landley <>
date Sun, 14 Apr 2013 21:43:22 -0500
parents 786841fdb1e0
children 4654f241ccbe
line wrap: on
line source

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


config HELP
  bool "help"
  default y
  depends on TOYBOX_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;