updated meviz to work with new commandline parsing API
[meviz.git] / src / main / java / eu / svjatoslav / meviz / htmlindexer / Main.java
1 package eu.svjatoslav.meviz.htmlindexer;
2
3 import java.util.ArrayList;
4
5 import eu.svjatoslav.meviz.Module;
6
7 public class Main implements Module {
8
9         CommandlineHandler commandlineHandler = new CommandlineHandler();
10
11         /** {@inheritDoc} */
12         @Override
13         public String getDescription() {
14                 return "Generate HTML listing of directories.";
15         }
16
17         /** {@inheritDoc} */
18         @Override
19         public String getModuleCommand() {
20                 return "index";
21         }
22
23         /** {@inheritDoc} */
24         @Override
25         public void run(final String[] args) throws Exception {
26
27                 final boolean parsingStatus = commandlineHandler
28                                 .parseCommandlineArguments(args);
29
30                 if (!parsingStatus) {
31                         showCommandlineHelp();
32                         return;
33                 }
34
35                 new FilesystemIndexer(commandlineHandler.getWorkingDirectory(),
36                                 commandlineHandler, new ArrayList<String>());
37
38         }
39
40         /** {@inheritDoc} */
41         @Override
42         public void showCommandlineHelp() {
43                 commandlineHandler.parser.showHelp();
44         }
45
46 }