java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java
author František Kučera <franta-hg@frantovo.cz>
Mon, 16 Dec 2013 20:01:37 +0100
branchv_0
changeset 16 5b8fcd35d4d6
parent 15 bbd335b5410c
child 17 d8ab8aece6f2
permissions -rw-r--r--
license: GNU GPLv3+
franta-hg@16
     1
/**
franta-hg@16
     2
 * SQL-DK
franta-hg@16
     3
 * Copyright © 2013 František Kučera (frantovo.cz)
franta-hg@16
     4
 *
franta-hg@16
     5
 * This program is free software: you can redistribute it and/or modify
franta-hg@16
     6
 * it under the terms of the GNU General Public License as published by
franta-hg@16
     7
 * the Free Software Foundation, either version 3 of the License, or
franta-hg@16
     8
 * (at your option) any later version.
franta-hg@16
     9
 *
franta-hg@16
    10
 * This program is distributed in the hope that it will be useful,
franta-hg@16
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@16
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@16
    13
 * GNU General Public License for more details.
franta-hg@16
    14
 *
franta-hg@16
    15
 * You should have received a copy of the GNU General Public License
franta-hg@16
    16
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
franta-hg@16
    17
 */
franta-hg@14
    18
package info.globalcode.sql.dk;
franta-hg@14
    19
franta-hg@14
    20
import java.io.PrintStream;
franta-hg@14
    21
import java.util.EnumSet;
franta-hg@14
    22
franta-hg@14
    23
/**
franta-hg@14
    24
 * Displays info like help, version etc.
franta-hg@14
    25
 *
franta-hg@14
    26
 * @author Ing. František Kučera (frantovo.cz)
franta-hg@14
    27
 */
franta-hg@14
    28
public class InfoLister {
franta-hg@14
    29
franta-hg@15
    30
	public void showInfo(CLIOptions options, PrintStream out) {
franta-hg@15
    31
		EnumSet<CLIOptions.INFO_TYPE> infoTypes = options.getShowInfo();
franta-hg@14
    32
		for (CLIOptions.INFO_TYPE infoType : infoTypes) {
franta-hg@14
    33
			switch (infoType) {
franta-hg@14
    34
				/**
franta-hg@14
    35
				 * TODO: implement show info
franta-hg@14
    36
				 */
franta-hg@14
    37
				case FORMATTERS:
franta-hg@14
    38
					out.println("TODO: list available formatters");
franta-hg@14
    39
					break;
franta-hg@14
    40
				case HELP:
franta-hg@14
    41
					out.println("TODO: show some help");
franta-hg@14
    42
					break;
franta-hg@14
    43
				case LICENSE:
franta-hg@14
    44
					out.println("TODO: show license");
franta-hg@14
    45
					break;
franta-hg@14
    46
				case TYPES:
franta-hg@14
    47
					out.println("TODO: list supported types");
franta-hg@14
    48
					break;
franta-hg@14
    49
				case VERSION:
franta-hg@14
    50
					out.println("TODO: show version");
franta-hg@14
    51
					break;
franta-hg@15
    52
				case DATABASES:
franta-hg@15
    53
					out.println("TODO: list databases");
franta-hg@15
    54
					break;
franta-hg@15
    55
				case CONNECTION:
franta-hg@15
    56
					out.println("TODO: test database connection: " + options.getDatabaseNameToTest());
franta-hg@15
    57
					break;
franta-hg@14
    58
				default:
franta-hg@14
    59
					throw new IllegalArgumentException("Unsupported INFO_TYPE: " + infoType);
franta-hg@14
    60
			}
franta-hg@14
    61
		}
franta-hg@14
    62
	}
franta-hg@14
    63
}