/*
 * @(#)CombinedOption.java
 *
 * Copyright (c) 2002-2003 JSCAPE
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JSCAPE. ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with JSCAPE.
 */

package com.jscape.util.cli;

import com.jscape.util.Assert;

/**
 * @author Alex
 * @version 1.0
 * @see <a href="CombinedOption.java.html">Source code</a>
 */
public class CombinedOption
        extends SingleOption {

    /**
     * @param name     name
     * @param position position
     */
    public CombinedOption(String name, int position) {
        super(name, true, position);
    }

    /**
     * @param option option
     *
     * @return found
     *
     * @see com.jscape.util.cli.AbstractOption#found(String)
     */
    protected boolean found(String option) {
        for (int i = 0; i < option.length(); ++i) {
            Assert.isTrue(this.name.indexOf(option.charAt(i)) >= 0, "unknown option");
        }

        return true;
    }

}
