Added command line usage.

This commit is contained in:
Erik C. Thauvin 2019-05-07 01:06:25 -07:00
parent dff03ed4e8
commit 6a6e800e93

View file

@ -8,8 +8,6 @@
A simple [JSP](http://www.oracle.com/technetwork/java/javaee/jsp/index.html) Tag Library to display the [code](#hscode), [reason](#hsreason) and/or [cause](#hscode) for [HTTP status codes](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html) in JSP error pages.
----
For example:
```jsp
@ -34,8 +32,6 @@ would display on a [501 status code](http://www.w3.org/Protocols/rfc2616/rfc2616
Not Implemented
----
## hs:cause
The `<hs:cause/>` tag displays the cause of current HTTP status code, if any. A shorthand for:
@ -152,8 +148,6 @@ Status Code | Reason
`598` | Network Read Timeout Error
`599` | Network Connect Timeout Error
----
## Usage with [Gradle](https://gradle.org/) or [Maven](http://maven.apache.org/)
Include the following in your `build.gradle` file:
@ -172,3 +166,33 @@ or as a Maven artifact:
<version>1.0.4</version>
</dependency>
```
## Command Line Usage
You can query the reason phrase for status code(s) as follows:
```sh
$ java -jar httpstatus-1.0.4.jar 404 500
404: Not Found
500: Internal Server Error
```
If no status code is specified, all status codes will be printed:
```sh
$ java -jar httpstatus-1.0.4.jar
100: Continue
101: Switching Protocols
102: Processing
103: Early Hints
200: OK
201: Created
202: Accepted
203: Non-Authoritative Information
204: No Content
205: Reset Content
206: Partial Content
207: Multi-Status
208: Already Reported
226: IM Used
...
```