1. Project Clover database Mon Aug 27 2018 22:12:52 BRT
  2. Package net.technearts.rip

File Cli.java

 

Coverage histogram

../../../img/srcFileCovDistChart0.png
50% of files have more coverage

Code metrics

0
10
2
1
42
31
3
0.3
5
2
1.5

Classes

Class Line # Actions
Cli 14 10 0% 3 12
0.00%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    package net.technearts.rip;
2   
3    import static net.technearts.rip.RipServer.localhost;
4   
5    import org.apache.commons.cli.CommandLine;
6    import org.apache.commons.cli.CommandLineParser;
7    import org.apache.commons.cli.DefaultParser;
8    import org.apache.commons.cli.Option;
9    import org.apache.commons.cli.Options;
10    import org.apache.commons.cli.ParseException;
11    import org.slf4j.Logger;
12    import org.slf4j.LoggerFactory;
13   
 
14    public class Cli {
15    private static final Logger logger = LoggerFactory.getLogger(Cli.class);
16   
 
17  0 toggle private static CommandLine commandLine(final String... args)
18    throws ParseException {
19  0 final CommandLineParser parser = new DefaultParser();
20  0 final Options options = new Options();
21  0 options.addOption(Option.builder("w").longOpt("workDir")
22    .desc("Working Directory").hasArg().build());
23  0 try {
24  0 return parser.parse(options, args);
25    } catch (final ParseException ex) {
26  0 logger.error(ex.getMessage());
27  0 throw ex;
28    }
29    }
30   
31    /**
32    *
33    * @param args parĂ¢metros de linha de comando.
34    * @throws ParseException se os parĂ¢metros estiverem errados.
35    */
 
36  0 toggle public static void main(final String[] args) throws ParseException {
37  0 final CommandLine line = commandLine(args);
38  0 final String workDir = line.getOptionValue("w", "/");
39  0 localhost(7777, workDir);
40    // TODO ler reqs em workDir e processar as chamadas
41    }
42    }