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