package net.happygiraffe.jslint;

/**
 * @author dom
 * @version $Id$
 */
public enum Option {
    //BEGIN-OPTIONS
    /**
     * If use of some browser features should be restricted.
     */
    ADSAFE("if use of some browser features should be restricted"),
    /**
     * If bitwise operators should not be allowed.
     */
    BITWISE("if bitwise operators should not be allowed"),
    /**
     * If the standard browser globals should be predefined.
     */
    BROWSER("if the standard browser globals should be predefined"),
    /**
     * If upper case HTML should be allowed.
     */
    CAP("if upper case HTML should be allowed"),
    /**
     * If debugger statements should be allowed.
     */
    DEBUG("if debugger statements should be allowed"),
    /**
     * If === should be required.
     */
    EQEQEQ("if === should be required"),
    /**
     * If eval should be allowed.
     */
    EVIL("if eval should be allowed"),
    /**
     * If HTML fragments should be allowed.
     */
    FRAGMENT("if HTML fragments should be allowed"),
    /**
     * If line breaks should not be checked.
     */
    LAXBREAK("if line breaks should not be checked"),
    /**
     * If names should be checked.
     */
    NOMEN("if names should be checked"),
    /**
     * If the scan should stop on first error.
     */
    PASSFAIL("if the scan should stop on first error"),
    /**
     * If increment/decrement should not be allowed.
     */
    PLUSPLUS("if increment/decrement should not be allowed"),
    /**
     * If the Rhino environment globals should be predefined.
     */
    RHINO("if the Rhino environment globals should be predefined"),
    /**
     * If undefined variables are errors.
     */
    UNDEF("if undefined variables are errors"),
    /**
     * If strict whitespace rules apply.
     */
    WHITE("if strict whitespace rules apply"),
    /**
     * If the Yahoo Widgets globals should be predefined.
     */
    WIDGET("if the Yahoo Widgets globals should be predefined");
    //END-OPTIONS

    private String description;

    Option(String description) {
        this.description = description;
    }

    /**
     * Return a description of what this option affects.
     */
    public String getDescription() {
        return description;
    }

    /**
     * Return the lowercase name of this option.
     */
    public String getLowerName() {
        return name().toLowerCase();
    }
    
    public static int maximumNameLength() {
        int maxOptLen = 0;
        for (Option o : values()) {
            int len = o.name().length();
            if (len > maxOptLen) {
                maxOptLen = len;
            }
        }
        return maxOptLen;
    }

    /**
     * Show this option and its description.
     */
    @Override
    public String toString() {
        return getLowerName() + "[" + getDescription() + "]";
    }
}

package net.happygiraffe.jslint;

/**
 * @author dom
 * @version $Id$
 */
public enum Option {
    //BEGIN-OPTIONS
    /** If use of some browser features should be restricted */
    ADSAFE("If use of some browser features should be restricted"),
    /** If bitwise operators should not be allowed */
    BITWISE("If bitwise operators should not be allowed"),
    /** If the standard browser globals should be predefined */
    BROWSER("If the standard browser globals should be predefined"),
    /** If upper case html should be allowed */
    CAP("If upper case html should be allowed"),
    /** If debugger statements should be allowed */
    DEBUG("If debugger statements should be allowed"),
    /** If === should be required */
    EQEQEQ("If === should be required"),
    /** If eval should be allowed */
    EVIL("If eval should be allowed"),
    /** If html fragments should be allowed */
    FRAGMENT("If html fragments should be allowed"),
    /** If line breaks should not be checked */
    LAXBREAK("If line breaks should not be checked"),
    /** If names should be checked */
    NOMEN("If names should be checked"),
    /** If the scan should stop on first error */
    PASSFAIL("If the scan should stop on first error"),
    /** If increment/decrement should not be allowed */
    PLUSPLUS("If increment/decrement should not be allowed"),
    /** If the rhino environment globals should be predefined */
    RHINO("If the rhino environment globals should be predefined"),
    /** If undefined variables are errors */
    UNDEF("If undefined variables are errors"),
    /** If strict whitespace rules apply */
    WHITE("If strict whitespace rules apply"),
    /** If the yahoo widgets globals should be predefined */
    WIDGET("If the yahoo widgets globals should be predefined");
    //END-OPTIONS

    private String description;

    Option(String description) {
        this.description = description;
    }

    /**
     * Return a description of what this option affects.
     */
    public String getDescription() {
        return description;
    }

    /**
     * Return the lowercase name of this option.
     */
    public String getLowerName() {
        return name().toLowerCase();
    }
    
    public static int maximumNameLength() {
        int maxOptLen = 0;
        for (Option o : values()) {
            int len = o.name().length();
            if (len > maxOptLen) {
                maxOptLen = len;
            }
        }
        return maxOptLen;
    }

    /**
     * Show this option and its description.
     */
    @Override
    public String toString() {
        return getLowerName() + "[" + getDescription() + "]";
    }
}
Update after running the ruby generator script.