/*
 * Add common commands
 */
{
    
    /*
     * quit
     *
     * quit	    - exit with code 0
     * quit N	    - exit with code N
     */
    void function do_quit (int args...)
    {
	int	code = 0;
	
	if (dim(args) > 0)
	    code = args[0];
	exit (code);
    }
    Command::new ("quit", do_quit);

    /*
     * history
     *
     * history	    - show some recent history
     * history N    - show N recent history
     * history N,M  - show history from N to M
     */
    void function do_history (int args...)
    {
	switch (dim (args)) {
	case 0:
	    History::show (format);
	    break;
	case 1:
	    History::show (format, args[0]);
	    break;
	default:
	    History::show (format, args[0], args[1]);
	    break;
	}
    }
    Command::new ("history", do_history);

    /*
     * print
     *
     * print name	- pretty print name
     */
    void function do_pretty_print (string[] names)
    {
	Command::pretty_print (stdout, names);
    }

    Command::new_names ("print", do_pretty_print);

    Command::new_names ("edit", Command::edit);

    Command::new_names ("undefine", Command::undefine);

    /*
     * load
     *
     * load "filename"	- read commands from "filename"
     */
    void function do_load (string f)
    {
	if (!Command::lex_file (f))
	    File::fprintf (stderr, "Cannot load file \"%s\"\n", f);
    }

    Command::new ("load", do_load);

    /*
     * library
     *
     * library "filename"   - Search library path for "filename" and
     *			      read commands from the first found
     */

    Command::new ("library", Command::lex_library);
}
