Skip to content

Commit

Permalink
Boolean option
Browse files Browse the repository at this point in the history
  • Loading branch information
cardil committed Jul 10, 2015
1 parent 25cc8e3 commit e9ff65a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright {yyyy} {name of copyright owner}
Copyright 2015 Wave Software

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# HTTP/S Java Checker

[![Build Status](https://travis-ci.org/wavesoftware/java-https-checker.svg?branch=master)](https://travis-ci.org/wavesoftware/java-https-checker) [![Coverage Status](https://coveralls.io/repos/wavesoftware/java-https-checker/badge.svg?branch=master&service=github)](https://coveralls.io/github/wavesoftware/java-https-checker?branch=master) [![Maven Central](https://img.shields.io/maven-central/v/pl.wavesoftware.utils/https-checker.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22pl.wavesoftware%22%20AND%20a%3A%22https-checker%22)

HTTP/S Java Checker - It can check is your Java installation can perform connection with given HTTPS address
Expand All @@ -8,6 +9,19 @@ HTTP/S Java Checker - It can check is your Java installation can perform connect
```bash
dpkg -i jhttps-checker_0.8.0.deb
jhttps-checker --help
usage: jhttps-checker [-h] [-q QUIET] [-r MAX_REDIRECTS] address

It can check is your Java installation can perform connection with given HTTPS address

positional arguments:
address Address to be checked

optional arguments:
-h, --help show this help message and exit
-q QUIET, --quiet QUIET
Do not display anything, only retcodes (default: false)
-r MAX_REDIRECTS, --max_redirects MAX_REDIRECTS
Number of redirects to perform at maximum (default: 10)
```

## Maven
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
public abstract class Cli {

public static final String APP_NAME = "HttpsChecker";
public static final String APP_NAME = "jhttps-checker";

public static final String DESCRIPTION = "It can check is your Java installation can perform connection "
+ "with given HTTPS address";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ private void addAddress(ArgumentParser parser, Arguments argument) {

private void addQuiet(ArgumentParser parser, Arguments argument) {
parser.addArgument(argument.config)
.action(net.sourceforge.argparse4j.impl.Arguments.storeTrue())
.setDefault(argument.defaultValue)
.type(argument.type)
.help(argument.help);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ public void testDoMain() {
assertNotNull(args);
assertEquals(0, result.retcode());

args = new String[]{"-q", "true", GOOGLE};
args = new String[]{"-q", GOOGLE};
result = HttpsCheckerMain.doMain(args);
assertNotNull(args);
assertEquals(0, result.retcode());

args = new String[]{"-q", "false", "--max_redirects", "3", GOOGLE};
args = new String[]{"-q", "-r", "3", GOOGLE};
result = HttpsCheckerMain.doMain(args);
assertNotNull(args);
assertEquals(0, result.retcode());

args = new String[]{"-quoa!", "false", "--max_redirects", "3"};
args = new String[]{"-quoa!", "--max_redirects", "3"};
result = HttpsCheckerMain.doMain(args);
assertNotNull(args);
assertEquals(Result.result(Cli.Retcodes.INVALID_ARGS).retcode(), result.retcode());
Expand Down

0 comments on commit e9ff65a

Please sign in to comment.