author | František Kučera <franta-hg@frantovo.cz> |
Mon, 16 Dec 2013 15:29:02 +0100 | |
branch | v_0 |
changeset 15 | bbd335b5410c |
parent 14 | 189b1260b942 |
child 16 | 5b8fcd35d4d6 |
permissions | -rw-r--r-- |
14 | 1 |
package info.globalcode.sql.dk; |
2 |
||
3 |
import java.io.PrintStream; |
|
4 |
import java.util.EnumSet; |
|
5 |
||
6 |
/** |
|
7 |
* Displays info like help, version etc. |
|
8 |
* |
|
9 |
* @author Ing. František Kučera (frantovo.cz) |
|
10 |
*/ |
|
11 |
public class InfoLister { |
|
12 |
||
15
bbd335b5410c
show info basics: list databases + test connection
František Kučera <franta-hg@frantovo.cz>
parents:
14
diff
changeset
|
13 |
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
|
14 |
EnumSet<CLIOptions.INFO_TYPE> infoTypes = options.getShowInfo(); |
14 | 15 |
for (CLIOptions.INFO_TYPE infoType : infoTypes) { |
16 |
switch (infoType) { |
|
17 |
/** |
|
18 |
* TODO: implement show info |
|
19 |
*/ |
|
20 |
case FORMATTERS: |
|
21 |
out.println("TODO: list available formatters"); |
|
22 |
break; |
|
23 |
case HELP: |
|
24 |
out.println("TODO: show some help"); |
|
25 |
break; |
|
26 |
case LICENSE: |
|
27 |
out.println("TODO: show license"); |
|
28 |
break; |
|
29 |
case TYPES: |
|
30 |
out.println("TODO: list supported types"); |
|
31 |
break; |
|
32 |
case VERSION: |
|
33 |
out.println("TODO: show version"); |
|
34 |
break; |
|
15
bbd335b5410c
show info basics: list databases + test connection
František Kučera <franta-hg@frantovo.cz>
parents:
14
diff
changeset
|
35 |
case DATABASES: |
bbd335b5410c
show info basics: list databases + test connection
František Kučera <franta-hg@frantovo.cz>
parents:
14
diff
changeset
|
36 |
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
|
37 |
break; |
bbd335b5410c
show info basics: list databases + test connection
František Kučera <franta-hg@frantovo.cz>
parents:
14
diff
changeset
|
38 |
case CONNECTION: |
bbd335b5410c
show info basics: list databases + test connection
František Kučera <franta-hg@frantovo.cz>
parents:
14
diff
changeset
|
39 |
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
|
40 |
break; |
14 | 41 |
default: |
42 |
throw new IllegalArgumentException("Unsupported INFO_TYPE: " + infoType); |
|
43 |
} |
|
44 |
} |
|
45 |
} |
|
46 |
} |