5c469d89609f109384fedfed1456bed3f9183999
[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                 if (commandlineHandler.parseCommandlineArguments(args))
28                         if (commandlineHandler.removeIndex.isParameterSpecified())
29                                 new FilesystemIndexRemover(commandlineHandler);
30                         else
31                                 new FilesystemIndexer(commandlineHandler.getWorkingDirectory(),
32                                                 commandlineHandler, new ArrayList<String>());
33
34         }
35
36         /** {@inheritDoc} */
37         @Override
38         public void showCommandlineHelp() {
39                 commandlineHandler.parser.showHelp();
40         }
41
42 }