author | František Kučera <franta-hg@frantovo.cz> |
Mon, 16 Dec 2013 20:01:37 +0100 | |
branch | v_0 |
changeset 16 | 5b8fcd35d4d6 |
parent 15 | bbd335b5410c |
child 17 | d8ab8aece6f2 |
permissions | -rw-r--r-- |
16
5b8fcd35d4d6
license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
1 |
/** |
5b8fcd35d4d6
license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
2 |
* SQL-DK |
5b8fcd35d4d6
license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
3 |
* Copyright © 2013 František Kučera (frantovo.cz) |
5b8fcd35d4d6
license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
4 |
* |
5b8fcd35d4d6
license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
5 |
* This program is free software: you can redistribute it and/or modify |
5b8fcd35d4d6
license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
6 |
* it under the terms of the GNU General Public License as published by |
5b8fcd35d4d6
license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
7 |
* the Free Software Foundation, either version 3 of the License, or |
5b8fcd35d4d6
license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
8 |
* (at your option) any later version. |
5b8fcd35d4d6
license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
9 |
* |
5b8fcd35d4d6
license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
10 |
* This program is distributed in the hope that it will be useful, |
5b8fcd35d4d6
license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
5b8fcd35d4d6
license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5b8fcd35d4d6
license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
13 |
* GNU General Public License for more details. |
5b8fcd35d4d6
license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
14 |
* |
5b8fcd35d4d6
license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License |
5b8fcd35d4d6
license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
16 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
5b8fcd35d4d6
license: GNU GPLv3+
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
17 |
*/ |
14 | 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 |
||
15
bbd335b5410c
show info basics: list databases + test connection
František Kučera <franta-hg@frantovo.cz>
parents:
14
diff
changeset
|
30 |
public void showInfo(CLIOptions options, PrintStream out) { |
bbd335b5410c
show info basics: list databases + test connection
František Kučera <franta-hg@frantovo.cz>
parents:
14
diff
changeset
|
31 |
EnumSet<CLIOptions.INFO_TYPE> infoTypes = options.getShowInfo(); |
14 | 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; |
|
15
bbd335b5410c
show info basics: list databases + test connection
František Kučera <franta-hg@frantovo.cz>
parents:
14
diff
changeset
|
52 |
case DATABASES: |
bbd335b5410c
show info basics: list databases + test connection
František Kučera <franta-hg@frantovo.cz>
parents:
14
diff
changeset
|
53 |
out.println("TODO: list databases"); |
bbd335b5410c
show info basics: list databases + test connection
František Kučera <franta-hg@frantovo.cz>
parents:
14
diff
changeset
|
54 |
break; |
bbd335b5410c
show info basics: list databases + test connection
František Kučera <franta-hg@frantovo.cz>
parents:
14
diff
changeset
|
55 |
case CONNECTION: |
bbd335b5410c
show info basics: list databases + test connection
František Kučera <franta-hg@frantovo.cz>
parents:
14
diff
changeset
|
56 |
out.println("TODO: test database connection: " + options.getDatabaseNameToTest()); |
bbd335b5410c
show info basics: list databases + test connection
František Kučera <franta-hg@frantovo.cz>
parents:
14
diff
changeset
|
57 |
break; |
14 | 58 |
default: |
59 |
throw new IllegalArgumentException("Unsupported INFO_TYPE: " + infoType); |
|
60 |
} |
|
61 |
} |
|
62 |
} |
|
63 |
} |