/*
 * Copyright (c) 2002-2011 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.inet.scp.protocol.marshaling;

/**
 * @author Alex Usun
 */
public enum CommandOption {

    PRESERVE_FILE_ATTRIBUTES('p'),
    RECURSIVE('r'),
    WRITE('t'),
    READ('f'),
    TARGET_DIRECTORY('d');

    public final char value;

    public static CommandOption optionFor(char value) {
        for (CommandOption option : values()) {
            if (option.value == value) {
                return option;
            }
        }

        throw new IllegalArgumentException("Unsupported value: " + value);
    }

    CommandOption(char value) {
        this.value = value;
    }

}
