/*
 * Optics / command.js
 * copyright (c) 2016 Susisu
 */

"use strict";

function endModule() {
    module.exports = Object.freeze({
        Argument,
        OptionalArgument,
        RequiredArgument,
        CommandBase,
        Command
    });
}

class Argument {
    constructor() {
    }
}

class OptionalArgument extends Argument {
    constructor(placeholder, defaultVal, reader) {
        super();
        this.placeholder = placeholder;
        this.defaultVal  = defaultVal;
        this.reader      = reader;
    }
}

class RequiredArgument extends Argument {
    constructor(placeholder, reader) {
        super();
        this.placeholder = placeholder;
        this.reader      = reader;
    }
}

class CommandBase {
    constructor() {
    }
}

class Command extends CommandBase {
    constructor(desc, opts, args, action) {
        super();
        this.desc   = desc;
        this.opts   = opts;
        this.args   = args;
        this.action = action;
    }
}

endModule();

@@ -53,16 +53,44 @@
 su%0A */%0A%0A
+/**%0A * @module command%0A */%0A%0A
 %22use str
@@ -739,92 +739,857 @@
 %0A%7D%0A%0A
-class CommandBase %7B%0A    constructor() %7B%0A    %7D%0A%7D%0A%0Aclass Command extends CommandBase %7B
+/**%0A * The %60CommandBase%60 class is the base class of commands.%0A * @static%0A */%0Aclass CommandBase %7B%0A    /**%0A     * Create an instance of %60CommandBase%60.%0A     */%0A    constructor() %7B%0A    %7D%0A%0A    /**%0A     * Parse %60argv%60 and run action associated with the command.%0A     * @param %7Bmodule:output.Output%7D output Output target.%0A     * @param %7Bstring%5B%5D%7D argv Command-line arguments.%0A     * @throws %7BError%7D Not implemented.%0A     */%0A    run(output, argv) %7B%0A        throw new Error(%22not implemented%22);%0A    %7D%0A%7D%0A%0A/**%0A * The %60Command%60 class represents an ordinary command.%0A * @extends module:command.CommandBase%0A * @static%0A */%0Aclass Command extends CommandBase %7B%0A    /**%0A     * Create an instance of %60Command%60.%0A     * @param %7Bstring%7D desc%0A     * @param %7Bmodule:option.Option%5B%5D%7D opts%0A     * @param %7Bmodule:command.Argument%5B%5D%7D args%0A     * @param %7BFunction%7D action%0A     */
 %0A   

Add JSDoc comments for CommandBase and Command