You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@commons.apache.org by br...@apache.org on 2015/05/09 20:19:17 UTC
svn commit: r950741 [26/40] - in
/websites/production/commons/content/proper/commons-cli: ./ apidocs/
apidocs/org/apache/commons/cli/ apidocs/org/apache/commons/cli/class-use/
apidocs/resources/ apidocs/src-html/org/apache/commons/cli/ cobertura/
jacoc...
Added: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/DefaultParser.html
==============================================================================
--- websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/DefaultParser.html (added)
+++ websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/DefaultParser.html Sat May 9 18:19:15 2015
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>DefaultParser</title><script type="text/javascript" src="../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons CLI</a> > <a href="index.html" class="el_package">org.apache.commons.cli</a> > <span class="el_class">DefaultParser</span></div><h1>DefaultParser</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortab
le" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">25 of 861</td><td class="ctr2">97%</td><td class="bar">11 of 158</td><td class="ctr2">93%</td><td class="ctr1">11</td><td class="ctr2">103</td><td class="ctr1">5</t
d><td class="ctr2">187</td><td class="ctr1">0</td><td class="ctr2">24</td></tr></tfoot><tbody><tr><td id="a10"><a href="DefaultParser.java.html#L471" class="el_method">handleShortAndLongOption(String)</a></td><td class="bar" id="b0"><img src="../.resources/redbar.gif" width="6" height="10" title="10" alt="10"/><img src="../.resources/greenbar.gif" width="113" height="10" title="169" alt="169"/></td><td class="ctr2" id="c20">94%</td><td class="bar" id="d1"><img src="../.resources/redbar.gif" width="9" height="10" title="2" alt="2"/><img src="../.resources/greenbar.gif" width="101" height="10" title="22" alt="22"/></td><td class="ctr2" id="e13">92%</td><td class="ctr1" id="f1">2</td><td class="ctr2" id="g1">13</td><td class="ctr1" id="h0">2</td><td class="ctr2" id="i0">39</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a15"><a href="DefaultParser.java.html#L312" class="el_method">isLongOption(String)</a></td><td class="bar" id="b1"><img src="../.reso
urces/redbar.gif" width="4" height="10" title="6" alt="6"/><img src="../.resources/greenbar.gif" width="25" height="10" title="38" alt="38"/></td><td class="ctr2" id="c22">86%</td><td class="bar" id="d0"><img src="../.resources/redbar.gif" width="13" height="10" title="3" alt="3"/><img src="../.resources/greenbar.gif" width="41" height="10" title="9" alt="9"/></td><td class="ctr2" id="e18">75%</td><td class="ctr1" id="f0">3</td><td class="ctr2" id="g3">7</td><td class="ctr1" id="h1">1</td><td class="ctr2" id="i6">9</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a23"><a href="DefaultParser.java.html#L624" class="el_method">updateRequiredOptions(Option)</a></td><td class="bar" id="b2"><img src="../.resources/redbar.gif" width="3" height="10" title="5" alt="5"/><img src="../.resources/greenbar.gif" width="17" height="10" title="26" alt="26"/></td><td class="ctr2" id="c23">84%</td><td class="bar" id="d5"><img src="../.resources/redbar.gif" width="4" h
eight="10" title="1" alt="1"/><img src="../.resources/greenbar.gif" width="23" height="10" title="5" alt="5"/></td><td class="ctr2" id="e15">83%</td><td class="ctr1" id="f2">1</td><td class="ctr2" id="g6">4</td><td class="ctr1" id="h2">1</td><td class="ctr2" id="i7">8</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr><tr><td id="a6"><a href="DefaultParser.java.html#L418" class="el_method">handleLongOptionWithEqual(String)</a></td><td class="bar" id="b3"><img src="../.resources/redbar.gif" width="2" height="10" title="4" alt="4"/><img src="../.resources/greenbar.gif" width="40" height="10" title="61" alt="61"/></td><td class="ctr2" id="c21">94%</td><td class="bar" id="d6"><img src="../.resources/redbar.gif" width="4" height="10" title="1" alt="1"/><img src="../.resources/greenbar.gif" width="23" height="10" title="5" alt="5"/></td><td class="ctr2" id="e16">83%</td><td class="ctr1" id="f3">1</td><td class="ctr2" id="g7">4</td><td class="ctr1" id="h3">1</td><td cla
ss="ctr2" id="i3">15</td><td class="ctr1" id="j3">0</td><td class="ctr2" id="k3">1</td></tr><tr><td id="a9"><a href="DefaultParser.java.html#L142" class="el_method">handleProperties(Properties)</a></td><td class="bar" id="b4"><img src="../.resources/greenbar.gif" width="57" height="10" title="86" alt="86"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d2"><img src="../.resources/redbar.gif" width="4" height="10" title="1" alt="1"/><img src="../.resources/greenbar.gif" width="115" height="10" title="25" alt="25"/></td><td class="ctr2" id="e11">96%</td><td class="ctr1" id="f4">1</td><td class="ctr2" id="g0">14</td><td class="ctr1" id="h4">0</td><td class="ctr2" id="i1">22</td><td class="ctr1" id="j4">0</td><td class="ctr2" id="k4">1</td></tr><tr><td id="a22"><a href="DefaultParser.java.html#L102" class="el_method">parse(Options, String[], Properties, boolean)</a></td><td class="bar" id="b5"><img src="../.resources/greenbar.gif" width="46" height="10" title="70" alt="70"/>
</td><td class="ctr2" id="c1">100%</td><td class="bar" id="d9"><img src="../.resources/greenbar.gif" width="27" height="10" title="6" alt="6"/></td><td class="ctr2" id="e0">100%</td><td class="ctr1" id="f8">0</td><td class="ctr2" id="g8">4</td><td class="ctr1" id="h5">0</td><td class="ctr2" id="i2">16</td><td class="ctr1" id="j5">0</td><td class="ctr2" id="k5">1</td></tr><tr><td id="a11"><a href="DefaultParser.java.html#L223" class="el_method">handleToken(String)</a></td><td class="bar" id="b6"><img src="../.resources/greenbar.gif" width="46" height="10" title="70" alt="70"/></td><td class="ctr2" id="c2">100%</td><td class="bar" id="d3"><img src="../.resources/redbar.gif" width="4" height="10" title="1" alt="1"/><img src="../.resources/greenbar.gif" width="87" height="10" title="19" alt="19"/></td><td class="ctr2" id="e12">95%</td><td class="ctr1" id="f5">1</td><td class="ctr2" id="g2">11</td><td class="ctr1" id="h6">0</td><td class="ctr2" id="i4">15</td><td class="ctr1" id="j6">0</
td><td class="ctr2" id="k6">1</td></tr><tr><td id="a4"><a href="DefaultParser.java.html#L672" class="el_method">handleConcatenatedOptions(String)</a></td><td class="bar" id="b7"><img src="../.resources/greenbar.gif" width="38" height="10" title="57" alt="57"/></td><td class="ctr2" id="c3">100%</td><td class="bar" id="d4"><img src="../.resources/redbar.gif" width="4" height="10" title="1" alt="1"/><img src="../.resources/greenbar.gif" width="50" height="10" title="11" alt="11"/></td><td class="ctr2" id="e14">92%</td><td class="ctr1" id="f6">1</td><td class="ctr2" id="g4">7</td><td class="ctr1" id="h7">0</td><td class="ctr2" id="i5">10</td><td class="ctr1" id="j7">0</td><td class="ctr2" id="k7">1</td></tr><tr><td id="a12"><a href="DefaultParser.java.html#L345" class="el_method">handleUnknownToken(String)</a></td><td class="bar" id="b8"><img src="../.resources/greenbar.gif" width="23" height="10" title="35" alt="35"/></td><td class="ctr2" id="c4">100%</td><td class="bar" id="d8"><img s
rc="../.resources/greenbar.gif" width="36" height="10" title="8" alt="8"/></td><td class="ctr2" id="e1">100%</td><td class="ctr1" id="f9">0</td><td class="ctr2" id="g5">5</td><td class="ctr1" id="h8">0</td><td class="ctr2" id="i11">6</td><td class="ctr1" id="j8">0</td><td class="ctr2" id="k8">1</td></tr><tr><td id="a7"><a href="DefaultParser.java.html#L391" class="el_method">handleLongOptionWithoutEqual(String)</a></td><td class="bar" id="b9"><img src="../.resources/greenbar.gif" width="22" height="10" title="33" alt="33"/></td><td class="ctr2" id="c5">100%</td><td class="bar" id="d11"><img src="../.resources/greenbar.gif" width="18" height="10" title="4" alt="4"/></td><td class="ctr2" id="e2">100%</td><td class="ctr1" id="f10">0</td><td class="ctr2" id="g11">3</td><td class="ctr1" id="h9">0</td><td class="ctr2" id="i10">7</td><td class="ctr1" id="j9">0</td><td class="ctr2" id="k9">1</td></tr><tr><td id="a3"><a href="DefaultParser.java.html#L568" class="el_method">getLongPrefix(Stri
ng)</a></td><td class="bar" id="b10"><img src="../.resources/greenbar.gif" width="20" height="10" title="30" alt="30"/></td><td class="ctr2" id="c6">100%</td><td class="bar" id="d12"><img src="../.resources/greenbar.gif" width="18" height="10" title="4" alt="4"/></td><td class="ctr2" id="e3">100%</td><td class="ctr1" id="f11">0</td><td class="ctr2" id="g12">3</td><td class="ctr1" id="h10">0</td><td class="ctr2" id="i8">8</td><td class="ctr1" id="j10">0</td><td class="ctr2" id="k10">1</td></tr><tr><td id="a14"><a href="DefaultParser.java.html#L590" class="el_method">isJavaProperty(String)</a></td><td class="bar" id="b11"><img src="../.resources/greenbar.gif" width="16" height="10" title="24" alt="24"/></td><td class="ctr2" id="c7">100%</td><td class="bar" id="d7"><img src="../.resources/redbar.gif" width="4" height="10" title="1" alt="1"/><img src="../.resources/greenbar.gif" width="23" height="10" title="5" alt="5"/></td><td class="ctr2" id="e17">83%</td><td class="ctr1" id="f7">1</
td><td class="ctr2" id="g9">4</td><td class="ctr1" id="h11">0</td><td class="ctr2" id="i14">3</td><td class="ctr1" id="j11">0</td><td class="ctr2" id="k11">1</td></tr><tr><td id="a8"><a href="DefaultParser.java.html#L599" class="el_method">handleOption(Option)</a></td><td class="bar" id="b12"><img src="../.resources/greenbar.gif" width="16" height="10" title="24" alt="24"/></td><td class="ctr2" id="c8">100%</td><td class="bar" id="d16"><img src="../.resources/greenbar.gif" width="9" height="10" title="2" alt="2"/></td><td class="ctr2" id="e4">100%</td><td class="ctr1" id="f12">0</td><td class="ctr2" id="g16">2</td><td class="ctr1" id="h12">0</td><td class="ctr2" id="i9">8</td><td class="ctr1" id="j12">0</td><td class="ctr2" id="k12">1</td></tr><tr><td id="a18"><a href="DefaultParser.java.html#L302" class="el_method">isShortOption(String)</a></td><td class="bar" id="b13"><img src="../.resources/greenbar.gif" width="13" height="10" title="20" alt="20"/></td><td class="ctr2" id="c9">10
0%</td><td class="bar" id="d10"><img src="../.resources/greenbar.gif" width="27" height="10" title="6" alt="6"/></td><td class="ctr2" id="e5">100%</td><td class="ctr1" id="f13">0</td><td class="ctr2" id="g10">4</td><td class="ctr1" id="h13">0</td><td class="ctr2" id="i17">1</td><td class="ctr1" id="j13">0</td><td class="ctr2" id="k13">1</td></tr><tr><td id="a0"><a href="DefaultParser.java.html#L209" class="el_method">checkRequiredArgs()</a></td><td class="bar" id="b14"><img src="../.resources/greenbar.gif" width="9" height="10" title="14" alt="14"/></td><td class="ctr2" id="c10">100%</td><td class="bar" id="d13"><img src="../.resources/greenbar.gif" width="18" height="10" title="4" alt="4"/></td><td class="ctr2" id="e6">100%</td><td class="ctr1" id="f14">0</td><td class="ctr2" id="g13">3</td><td class="ctr1" id="h14">0</td><td class="ctr2" id="i15">3</td><td class="ctr1" id="j14">0</td><td class="ctr2" id="k14">1</td></tr><tr><td id="a5"><a href="DefaultParser.java.html#L369" class=
"el_method">handleLongOption(String)</a></td><td class="bar" id="b15"><img src="../.resources/greenbar.gif" width="8" height="10" title="13" alt="13"/></td><td class="ctr2" id="c11">100%</td><td class="bar" id="d17"><img src="../.resources/greenbar.gif" width="9" height="10" title="2" alt="2"/></td><td class="ctr2" id="e7">100%</td><td class="ctr1" id="f15">0</td><td class="ctr2" id="g17">2</td><td class="ctr1" id="h15">0</td><td class="ctr2" id="i12">4</td><td class="ctr1" id="j15">0</td><td class="ctr2" id="k15">1</td></tr><tr><td id="a13"><a href="DefaultParser.java.html#L263" class="el_method">isArgument(String)</a></td><td class="bar" id="b16"><img src="../.resources/greenbar.gif" width="8" height="10" title="12" alt="12"/></td><td class="ctr2" id="c12">100%</td><td class="bar" id="d14"><img src="../.resources/greenbar.gif" width="18" height="10" title="4" alt="4"/></td><td class="ctr2" id="e8">100%</td><td class="ctr1" id="f16">0</td><td class="ctr2" id="g14">3</td><td class="
ctr1" id="h16">0</td><td class="ctr2" id="i18">1</td><td class="ctr1" id="j16">0</td><td class="ctr2" id="k16">1</td></tr><tr><td id="a17"><a href="DefaultParser.java.html#L291" class="el_method">isOption(String)</a></td><td class="bar" id="b17"><img src="../.resources/greenbar.gif" width="8" height="10" title="12" alt="12"/></td><td class="ctr2" id="c13">100%</td><td class="bar" id="d15"><img src="../.resources/greenbar.gif" width="18" height="10" title="4" alt="4"/></td><td class="ctr2" id="e9">100%</td><td class="ctr1" id="f17">0</td><td class="ctr2" id="g15">3</td><td class="ctr1" id="h17">0</td><td class="ctr2" id="i19">1</td><td class="ctr1" id="j17">0</td><td class="ctr2" id="k17">1</td></tr><tr><td id="a1"><a href="DefaultParser.java.html#L197" class="el_method">checkRequiredOptions()</a></td><td class="bar" id="b18"><img src="../.resources/greenbar.gif" width="7" height="10" title="11" alt="11"/></td><td class="ctr2" id="c14">100%</td><td class="bar" id="d18"><img src="../.
resources/greenbar.gif" width="9" height="10" title="2" alt="2"/></td><td class="ctr2" id="e10">100%</td><td class="ctr1" id="f18">0</td><td class="ctr2" id="g18">2</td><td class="ctr1" id="h18">0</td><td class="ctr2" id="i16">3</td><td class="ctr1" id="j18">0</td><td class="ctr2" id="k18">1</td></tr><tr><td id="a16"><a href="DefaultParser.java.html#L275" class="el_method">isNegativeNumber(String)</a></td><td class="bar" id="b19"><img src="../.resources/greenbar.gif" width="5" height="10" title="8" alt="8"/></td><td class="ctr2" id="c15">100%</td><td class="bar" id="d19"/><td class="ctr2" id="e19">n/a</td><td class="ctr1" id="f19">0</td><td class="ctr2" id="g19">1</td><td class="ctr1" id="h19">0</td><td class="ctr2" id="i13">4</td><td class="ctr1" id="j19">0</td><td class="ctr2" id="k19">1</td></tr><tr><td id="a21"><a href="DefaultParser.java.html#L76" class="el_method">parse(Options, String[], Properties)</a></td><td class="bar" id="b20"><img src="../.resources/greenbar.gif" width=
"4" height="10" title="7" alt="7"/></td><td class="ctr2" id="c16">100%</td><td class="bar" id="d20"/><td class="ctr2" id="e20">n/a</td><td class="ctr1" id="f20">0</td><td class="ctr2" id="g20">1</td><td class="ctr1" id="h20">0</td><td class="ctr2" id="i20">1</td><td class="ctr1" id="j20">0</td><td class="ctr2" id="k20">1</td></tr><tr><td id="a20"><a href="DefaultParser.java.html#L81" class="el_method">parse(Options, String[], boolean)</a></td><td class="bar" id="b21"><img src="../.resources/greenbar.gif" width="4" height="10" title="7" alt="7"/></td><td class="ctr2" id="c17">100%</td><td class="bar" id="d21"/><td class="ctr2" id="e21">n/a</td><td class="ctr1" id="f21">0</td><td class="ctr2" id="g21">1</td><td class="ctr1" id="h21">0</td><td class="ctr2" id="i21">1</td><td class="ctr1" id="j21">0</td><td class="ctr2" id="k21">1</td></tr><tr><td id="a19"><a href="DefaultParser.java.html#L60" class="el_method">parse(Options, String[])</a></td><td class="bar" id="b22"><img src="../.reso
urces/greenbar.gif" width="4" height="10" title="6" alt="6"/></td><td class="ctr2" id="c18">100%</td><td class="bar" id="d22"/><td class="ctr2" id="e22">n/a</td><td class="ctr1" id="f22">0</td><td class="ctr2" id="g22">1</td><td class="ctr1" id="h22">0</td><td class="ctr2" id="i22">1</td><td class="ctr1" id="j22">0</td><td class="ctr2" id="k22">1</td></tr><tr><td id="a2"><a href="DefaultParser.java.html#L31" class="el_method">DefaultParser()</a></td><td class="bar" id="b23"><img src="../.resources/greenbar.gif" width="2" height="10" title="3" alt="3"/></td><td class="ctr2" id="c19">100%</td><td class="bar" id="d23"/><td class="ctr2" id="e23">n/a</td><td class="ctr1" id="f23">0</td><td class="ctr2" id="g23">1</td><td class="ctr1" id="h23">0</td><td class="ctr2" id="i23">1</td><td class="ctr1" id="j23">0</td><td class="ctr2" id="k23">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</sp
an></div></body></html>
\ No newline at end of file
Propchange: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/DefaultParser.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/DefaultParser.java.html
==============================================================================
--- websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/DefaultParser.java.html (added)
+++ websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/DefaultParser.java.html Sat May 9 18:19:15 2015
@@ -0,0 +1,695 @@
+<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>DefaultParser.java</title><link rel="stylesheet" href="../.resources/prettify.css" type="text/css"/><script type="text/javascript" src="../.resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons CLI</a> > <a href="index.source.html" class="el_package">org.apache.commons.cli</a> > <span class="el_source">DefaultParser.java</span></div><h
1>DefaultParser.java</h1><pre class="source lang-java linenums">/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.cli;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * Default parser.
+ *
+ * @version $Id: DefaultParser.java 1677406 2015-05-03 14:27:31Z britter $
+ * @since 1.3
+ */
+<span class="fc" id="L31">public class DefaultParser implements CommandLineParser</span>
+{
+ /** The command-line instance. */
+ protected CommandLine cmd;
+
+ /** The current options. */
+ protected Options options;
+
+ /**
+ * Flag indicating how unrecognized tokens are handled. <tt>true</tt> to stop
+ * the parsing and add the remaining tokens to the args list.
+ * <tt>false</tt> to throw an exception.
+ */
+ protected boolean stopAtNonOption;
+
+ /** The token currently processed. */
+ protected String currentToken;
+
+ /** The last option parsed. */
+ protected Option currentOption;
+
+ /** Flag indicating if tokens should no longer be analysed and simply added as arguments of the command line. */
+ protected boolean skipParsing;
+
+ /** The required options and groups expected to be found when parsing the command line. */
+ protected List expectedOpts;
+
+ public CommandLine parse(Options options, String[] arguments) throws ParseException
+ {
+<span class="fc" id="L60"> return parse(options, arguments, null);</span>
+ }
+
+ /**
+ * Parse the arguments according to the specified options and properties.
+ *
+ * @param options the specified Options
+ * @param arguments the command line arguments
+ * @param properties command line option name-value pairs
+ * @return the list of atomic option and value tokens
+ *
+ * @throws ParseException if there are any problems encountered
+ * while parsing the command line tokens.
+ */
+ public CommandLine parse(Options options, String[] arguments, Properties properties) throws ParseException
+ {
+<span class="fc" id="L76"> return parse(options, arguments, properties, false);</span>
+ }
+
+ public CommandLine parse(Options options, String[] arguments, boolean stopAtNonOption) throws ParseException
+ {
+<span class="fc" id="L81"> return parse(options, arguments, null, stopAtNonOption);</span>
+ }
+
+ /**
+ * Parse the arguments according to the specified options and properties.
+ *
+ * @param options the specified Options
+ * @param arguments the command line arguments
+ * @param properties command line option name-value pairs
+ * @param stopAtNonOption if <tt>true</tt> an unrecognized argument stops
+ * the parsing and the remaining arguments are added to the
+ * {@link CommandLine}s args list. If <tt>false</tt> an unrecognized
+ * argument triggers a ParseException.
+ *
+ * @return the list of atomic option and value tokens
+ * @throws ParseException if there are any problems encountered
+ * while parsing the command line tokens.
+ */
+ public CommandLine parse(Options options, String[] arguments, Properties properties, boolean stopAtNonOption)
+ throws ParseException
+ {
+<span class="fc" id="L102"> this.options = options;</span>
+<span class="fc" id="L103"> this.stopAtNonOption = stopAtNonOption;</span>
+<span class="fc" id="L104"> skipParsing = false;</span>
+<span class="fc" id="L105"> currentOption = null;</span>
+<span class="fc" id="L106"> expectedOpts = new ArrayList(options.getRequiredOptions());</span>
+
+ // clear the data from the groups
+<span class="fc bfc" id="L109" title="All 2 branches covered."> for (OptionGroup group : options.getOptionGroups())</span>
+ {
+<span class="fc" id="L111"> group.setSelected(null);</span>
+<span class="fc" id="L112"> }</span>
+
+<span class="fc" id="L114"> cmd = new CommandLine();</span>
+
+<span class="fc bfc" id="L116" title="All 2 branches covered."> if (arguments != null)</span>
+ {
+<span class="fc bfc" id="L118" title="All 2 branches covered."> for (String argument : arguments)</span>
+ {
+<span class="fc" id="L120"> handleToken(argument);</span>
+ }
+ }
+
+ // check the arguments of the last option
+<span class="fc" id="L125"> checkRequiredArgs();</span>
+
+ // add the default options
+<span class="fc" id="L128"> handleProperties(properties);</span>
+
+<span class="fc" id="L130"> checkRequiredOptions();</span>
+
+<span class="fc" id="L132"> return cmd;</span>
+ }
+
+ /**
+ * Sets the values of Options using the values in <code>properties</code>.
+ *
+ * @param properties The value properties to be processed.
+ */
+ private void handleProperties(Properties properties) throws ParseException
+ {
+<span class="fc bfc" id="L142" title="All 2 branches covered."> if (properties == null)</span>
+ {
+<span class="fc" id="L144"> return;</span>
+ }
+
+<span class="fc bfc" id="L147" title="All 2 branches covered."> for (Enumeration<?> e = properties.propertyNames(); e.hasMoreElements();)</span>
+ {
+<span class="fc" id="L149"> String option = e.nextElement().toString();</span>
+
+<span class="fc" id="L151"> Option opt = options.getOption(option);</span>
+<span class="fc bfc" id="L152" title="All 2 branches covered."> if (opt == null)</span>
+ {
+<span class="fc" id="L154"> throw new UnrecognizedOptionException("Default option wasn't defined", option);</span>
+ }
+
+ // if the option is part of a group, check if another option of the group has been selected
+<span class="fc" id="L158"> OptionGroup group = options.getOptionGroup(opt);</span>
+<span class="fc bfc" id="L159" title="All 4 branches covered."> boolean selected = group != null && group.getSelected() != null;</span>
+
+<span class="fc bfc" id="L161" title="All 4 branches covered."> if (!cmd.hasOption(option) && !selected)</span>
+ {
+ // get the value from the properties
+<span class="fc" id="L164"> String value = properties.getProperty(option);</span>
+
+<span class="fc bfc" id="L166" title="All 2 branches covered."> if (opt.hasArg())</span>
+ {
+<span class="pc bpc" id="L168" title="1 of 4 branches missed."> if (opt.getValues() == null || opt.getValues().length == 0)</span>
+ {
+<span class="fc" id="L170"> opt.addValueForProcessing(value);</span>
+ }
+ }
+<span class="fc bfc" id="L173" title="All 2 branches covered."> else if (!("yes".equalsIgnoreCase(value)</span>
+<span class="fc bfc" id="L174" title="All 2 branches covered."> || "true".equalsIgnoreCase(value)</span>
+<span class="fc bfc" id="L175" title="All 2 branches covered."> || "1".equalsIgnoreCase(value)))</span>
+ {
+ // if the value is not yes, true or 1 then don't add the option to the CommandLine
+<span class="fc" id="L178"> continue;</span>
+ }
+
+<span class="fc" id="L181"> handleOption(opt);</span>
+<span class="fc" id="L182"> currentOption = null;</span>
+ }
+<span class="fc" id="L184"> }</span>
+<span class="fc" id="L185"> }</span>
+
+ /**
+ * Throws a {@link MissingOptionException} if all of the required options
+ * are not present.
+ *
+ * @throws MissingOptionException if any of the required Options
+ * are not present.
+ */
+ private void checkRequiredOptions() throws MissingOptionException
+ {
+ // if there are required options that have not been processed
+<span class="fc bfc" id="L197" title="All 2 branches covered."> if (!expectedOpts.isEmpty())</span>
+ {
+<span class="fc" id="L199"> throw new MissingOptionException(expectedOpts);</span>
+ }
+<span class="fc" id="L201"> }</span>
+
+ /**
+ * Throw a {@link MissingArgumentException} if the current option
+ * didn't receive the number of arguments expected.
+ */
+ private void checkRequiredArgs() throws ParseException
+ {
+<span class="fc bfc" id="L209" title="All 4 branches covered."> if (currentOption != null && currentOption.requiresArg())</span>
+ {
+<span class="fc" id="L211"> throw new MissingArgumentException(currentOption);</span>
+ }
+<span class="fc" id="L213"> }</span>
+
+ /**
+ * Handle any command line token.
+ *
+ * @param token the command line token to handle
+ * @throws ParseException
+ */
+ private void handleToken(String token) throws ParseException
+ {
+<span class="fc" id="L223"> currentToken = token;</span>
+
+<span class="fc bfc" id="L225" title="All 2 branches covered."> if (skipParsing)</span>
+ {
+<span class="fc" id="L227"> cmd.addArg(token);</span>
+ }
+<span class="fc bfc" id="L229" title="All 2 branches covered."> else if ("--".equals(token))</span>
+ {
+<span class="fc" id="L231"> skipParsing = true;</span>
+ }
+<span class="pc bpc" id="L233" title="1 of 6 branches missed."> else if (currentOption != null && currentOption.acceptsArg() && isArgument(token))</span>
+ {
+<span class="fc" id="L235"> currentOption.addValueForProcessing(Util.stripLeadingAndTrailingQuotes(token));</span>
+ }
+<span class="fc bfc" id="L237" title="All 2 branches covered."> else if (token.startsWith("--"))</span>
+ {
+<span class="fc" id="L239"> handleLongOption(token);</span>
+ }
+<span class="fc bfc" id="L241" title="All 4 branches covered."> else if (token.startsWith("-") && !"-".equals(token))</span>
+ {
+<span class="fc" id="L243"> handleShortAndLongOption(token);</span>
+ }
+ else
+ {
+<span class="fc" id="L247"> handleUnknownToken(token);</span>
+ }
+
+<span class="fc bfc" id="L250" title="All 4 branches covered."> if (currentOption != null && !currentOption.acceptsArg())</span>
+ {
+<span class="fc" id="L252"> currentOption = null;</span>
+ }
+<span class="fc" id="L254"> }</span>
+
+ /**
+ * Returns true is the token is a valid argument.
+ *
+ * @param token
+ */
+ private boolean isArgument(String token)
+ {
+<span class="fc bfc" id="L263" title="All 4 branches covered."> return !isOption(token) || isNegativeNumber(token);</span>
+ }
+
+ /**
+ * Check if the token is a negative number.
+ *
+ * @param token
+ */
+ private boolean isNegativeNumber(String token)
+ {
+ try
+ {
+<span class="fc" id="L275"> Double.parseDouble(token);</span>
+<span class="fc" id="L276"> return true;</span>
+ }
+<span class="fc" id="L278"> catch (NumberFormatException e)</span>
+ {
+<span class="fc" id="L280"> return false;</span>
+ }
+ }
+
+ /**
+ * Tells if the token looks like an option.
+ *
+ * @param token
+ */
+ private boolean isOption(String token)
+ {
+<span class="fc bfc" id="L291" title="All 4 branches covered."> return isLongOption(token) || isShortOption(token);</span>
+ }
+
+ /**
+ * Tells if the token looks like a short option.
+ *
+ * @param token
+ */
+ private boolean isShortOption(String token)
+ {
+ // short options (-S, -SV, -S=V, -SV1=V2, -S1S2)
+<span class="fc bfc" id="L302" title="All 6 branches covered."> return token.startsWith("-") && token.length() >= 2 && options.hasShortOption(token.substring(1, 2));</span>
+ }
+
+ /**
+ * Tells if the token looks like a long option.
+ *
+ * @param token
+ */
+ private boolean isLongOption(String token)
+ {
+<span class="fc bfc" id="L312" title="All 4 branches covered."> if (!token.startsWith("-") || token.length() == 1)</span>
+ {
+<span class="fc" id="L314"> return false;</span>
+ }
+
+<span class="fc" id="L317"> int pos = token.indexOf("=");</span>
+<span class="pc bpc" id="L318" title="1 of 2 branches missed."> String t = pos == -1 ? token : token.substring(0, pos);</span>
+
+<span class="pc bpc" id="L320" title="1 of 2 branches missed."> if (!options.getMatchingOptions(t).isEmpty())</span>
+ {
+ // long or partial long options (--L, -L, --L=V, -L=V, --l, --l=V)
+<span class="nc" id="L323"> return true;</span>
+ }
+<span class="pc bpc" id="L325" title="1 of 4 branches missed."> else if (getLongPrefix(token) != null && !token.startsWith("--"))</span>
+ {
+ // -LV
+<span class="fc" id="L328"> return true;</span>
+ }
+
+<span class="fc" id="L331"> return false;</span>
+ }
+
+ /**
+ * Handles an unknown token. If the token starts with a dash an
+ * UnrecognizedOptionException is thrown. Otherwise the token is added
+ * to the arguments of the command line. If the stopAtNonOption flag
+ * is set, this stops the parsing and the remaining tokens are added
+ * as-is in the arguments of the command line.
+ *
+ * @param token the command line token to handle
+ */
+ private void handleUnknownToken(String token) throws ParseException
+ {
+<span class="fc bfc" id="L345" title="All 6 branches covered."> if (token.startsWith("-") && token.length() > 1 && !stopAtNonOption)</span>
+ {
+<span class="fc" id="L347"> throw new UnrecognizedOptionException("Unrecognized option: " + token, token);</span>
+ }
+
+<span class="fc" id="L350"> cmd.addArg(token);</span>
+<span class="fc bfc" id="L351" title="All 2 branches covered."> if (stopAtNonOption)</span>
+ {
+<span class="fc" id="L353"> skipParsing = true;</span>
+ }
+<span class="fc" id="L355"> }</span>
+
+ /**
+ * Handles the following tokens:
+ *
+ * --L
+ * --L=V
+ * --L V
+ * --l
+ *
+ * @param token the command line token to handle
+ */
+ private void handleLongOption(String token) throws ParseException
+ {
+<span class="fc bfc" id="L369" title="All 2 branches covered."> if (token.indexOf('=') == -1)</span>
+ {
+<span class="fc" id="L371"> handleLongOptionWithoutEqual(token);</span>
+ }
+ else
+ {
+<span class="fc" id="L375"> handleLongOptionWithEqual(token);</span>
+ }
+<span class="fc" id="L377"> }</span>
+
+ /**
+ * Handles the following tokens:
+ *
+ * --L
+ * -L
+ * --l
+ * -l
+ *
+ * @param token the command line token to handle
+ */
+ private void handleLongOptionWithoutEqual(String token) throws ParseException
+ {
+<span class="fc" id="L391"> List<String> matchingOpts = options.getMatchingOptions(token);</span>
+<span class="fc bfc" id="L392" title="All 2 branches covered."> if (matchingOpts.isEmpty())</span>
+ {
+<span class="fc" id="L394"> handleUnknownToken(currentToken);</span>
+ }
+<span class="fc bfc" id="L396" title="All 2 branches covered."> else if (matchingOpts.size() > 1)</span>
+ {
+<span class="fc" id="L398"> throw new AmbiguousOptionException(token, matchingOpts);</span>
+ }
+ else
+ {
+<span class="fc" id="L402"> handleOption(options.getOption(matchingOpts.get(0)));</span>
+ }
+<span class="fc" id="L404"> }</span>
+
+ /**
+ * Handles the following tokens:
+ *
+ * --L=V
+ * -L=V
+ * --l=V
+ * -l=V
+ *
+ * @param token the command line token to handle
+ */
+ private void handleLongOptionWithEqual(String token) throws ParseException
+ {
+<span class="fc" id="L418"> int pos = token.indexOf('=');</span>
+
+<span class="fc" id="L420"> String value = token.substring(pos + 1);</span>
+
+<span class="fc" id="L422"> String opt = token.substring(0, pos);</span>
+
+<span class="fc" id="L424"> List<String> matchingOpts = options.getMatchingOptions(opt);</span>
+<span class="fc bfc" id="L425" title="All 2 branches covered."> if (matchingOpts.isEmpty())</span>
+ {
+<span class="fc" id="L427"> handleUnknownToken(currentToken);</span>
+ }
+<span class="fc bfc" id="L429" title="All 2 branches covered."> else if (matchingOpts.size() > 1)</span>
+ {
+<span class="fc" id="L431"> throw new AmbiguousOptionException(opt, matchingOpts);</span>
+ }
+ else
+ {
+<span class="fc" id="L435"> Option option = options.getOption(matchingOpts.get(0));</span>
+
+<span class="pc bpc" id="L437" title="1 of 2 branches missed."> if (option.acceptsArg())</span>
+ {
+<span class="fc" id="L439"> handleOption(option);</span>
+<span class="fc" id="L440"> currentOption.addValueForProcessing(value);</span>
+<span class="fc" id="L441"> currentOption = null;</span>
+ }
+ else
+ {
+<span class="nc" id="L445"> handleUnknownToken(currentToken);</span>
+ }
+ }
+<span class="fc" id="L448"> }</span>
+
+ /**
+ * Handles the following tokens:
+ *
+ * -S
+ * -SV
+ * -S V
+ * -S=V
+ * -S1S2
+ * -S1S2 V
+ * -SV1=V2
+ *
+ * -L
+ * -LV
+ * -L V
+ * -L=V
+ * -l
+ *
+ * @param token the command line token to handle
+ */
+ private void handleShortAndLongOption(String token) throws ParseException
+ {
+<span class="fc" id="L471"> String t = Util.stripLeadingHyphens(token);</span>
+
+<span class="fc" id="L473"> int pos = t.indexOf('=');</span>
+
+<span class="fc bfc" id="L475" title="All 2 branches covered."> if (t.length() == 1)</span>
+ {
+ // -S
+<span class="fc bfc" id="L478" title="All 2 branches covered."> if (options.hasShortOption(t))</span>
+ {
+<span class="fc" id="L480"> handleOption(options.getOption(t));</span>
+ }
+ else
+ {
+<span class="fc" id="L484"> handleUnknownToken(token);</span>
+ }
+ }
+<span class="fc bfc" id="L487" title="All 2 branches covered."> else if (pos == -1)</span>
+ {
+ // no equal sign found (-xxx)
+<span class="pc bpc" id="L490" title="1 of 2 branches missed."> if (options.hasShortOption(t))</span>
+ {
+<span class="nc" id="L492"> handleOption(options.getOption(t));</span>
+ }
+<span class="fc bfc" id="L494" title="All 2 branches covered."> else if (!options.getMatchingOptions(t).isEmpty())</span>
+ {
+ // -L or -l
+<span class="fc" id="L497"> handleLongOptionWithoutEqual(token);</span>
+ }
+ else
+ {
+ // look for a long prefix (-Xmx512m)
+<span class="fc" id="L502"> String opt = getLongPrefix(t);</span>
+
+<span class="fc bfc" id="L504" title="All 4 branches covered."> if (opt != null && options.getOption(opt).acceptsArg())</span>
+ {
+<span class="fc" id="L506"> handleOption(options.getOption(opt));</span>
+<span class="fc" id="L507"> currentOption.addValueForProcessing(t.substring(opt.length()));</span>
+<span class="fc" id="L508"> currentOption = null;</span>
+ }
+<span class="fc bfc" id="L510" title="All 2 branches covered."> else if (isJavaProperty(t))</span>
+ {
+ // -SV1 (-Dflag)
+<span class="fc" id="L513"> handleOption(options.getOption(t.substring(0, 1)));</span>
+<span class="fc" id="L514"> currentOption.addValueForProcessing(t.substring(1));</span>
+<span class="fc" id="L515"> currentOption = null;</span>
+ }
+ else
+ {
+ // -S1S2S3 or -S1S2V
+<span class="fc" id="L520"> handleConcatenatedOptions(token);</span>
+ }
+<span class="fc" id="L522"> }</span>
+ }
+ else
+ {
+ // equal sign found (-xxx=yyy)
+<span class="fc" id="L527"> String opt = t.substring(0, pos);</span>
+<span class="fc" id="L528"> String value = t.substring(pos + 1);</span>
+
+<span class="fc bfc" id="L530" title="All 2 branches covered."> if (opt.length() == 1)</span>
+ {
+ // -S=V
+<span class="fc" id="L533"> Option option = options.getOption(opt);</span>
+<span class="pc bpc" id="L534" title="1 of 4 branches missed."> if (option != null && option.acceptsArg())</span>
+ {
+<span class="fc" id="L536"> handleOption(option);</span>
+<span class="fc" id="L537"> currentOption.addValueForProcessing(value);</span>
+<span class="fc" id="L538"> currentOption = null;</span>
+ }
+ else
+ {
+<span class="nc" id="L542"> handleUnknownToken(token);</span>
+ }
+<span class="fc" id="L544"> }</span>
+<span class="fc bfc" id="L545" title="All 2 branches covered."> else if (isJavaProperty(opt))</span>
+ {
+ // -SV1=V2 (-Dkey=value)
+<span class="fc" id="L548"> handleOption(options.getOption(opt.substring(0, 1)));</span>
+<span class="fc" id="L549"> currentOption.addValueForProcessing(opt.substring(1));</span>
+<span class="fc" id="L550"> currentOption.addValueForProcessing(value);</span>
+<span class="fc" id="L551"> currentOption = null;</span>
+ }
+ else
+ {
+ // -L=V or -l=V
+<span class="fc" id="L556"> handleLongOptionWithEqual(token);</span>
+ }
+ }
+<span class="fc" id="L559"> }</span>
+
+ /**
+ * Search for a prefix that is the long name of an option (-Xmx512m)
+ *
+ * @param token
+ */
+ private String getLongPrefix(String token)
+ {
+<span class="fc" id="L568"> String t = Util.stripLeadingHyphens(token);</span>
+
+ int i;
+<span class="fc" id="L571"> String opt = null;</span>
+<span class="fc bfc" id="L572" title="All 2 branches covered."> for (i = t.length() - 2; i > 1; i--)</span>
+ {
+<span class="fc" id="L574"> String prefix = t.substring(0, i);</span>
+<span class="fc bfc" id="L575" title="All 2 branches covered."> if (options.hasLongOption(prefix))</span>
+ {
+<span class="fc" id="L577"> opt = prefix;</span>
+<span class="fc" id="L578"> break;</span>
+ }
+ }
+
+<span class="fc" id="L582"> return opt;</span>
+ }
+
+ /**
+ * Check if the specified token is a Java-like property (-Dkey=value).
+ */
+ private boolean isJavaProperty(String token)
+ {
+<span class="fc" id="L590"> String opt = token.substring(0, 1);</span>
+<span class="fc" id="L591"> Option option = options.getOption(opt);</span>
+
+<span class="pc bpc" id="L593" title="1 of 6 branches missed."> return option != null && (option.getArgs() >= 2 || option.getArgs() == Option.UNLIMITED_VALUES);</span>
+ }
+
+ private void handleOption(Option option) throws ParseException
+ {
+ // check the previous option before handling the next one
+<span class="fc" id="L599"> checkRequiredArgs();</span>
+
+<span class="fc" id="L601"> option = (Option) option.clone();</span>
+
+<span class="fc" id="L603"> updateRequiredOptions(option);</span>
+
+<span class="fc" id="L605"> cmd.addOption(option);</span>
+
+<span class="fc bfc" id="L607" title="All 2 branches covered."> if (option.hasArg())</span>
+ {
+<span class="fc" id="L609"> currentOption = option;</span>
+ }
+ else
+ {
+<span class="fc" id="L613"> currentOption = null;</span>
+ }
+<span class="fc" id="L615"> }</span>
+
+ /**
+ * Removes the option or its group from the list of expected elements.
+ *
+ * @param option
+ */
+ private void updateRequiredOptions(Option option) throws AlreadySelectedException
+ {
+<span class="fc bfc" id="L624" title="All 2 branches covered."> if (option.isRequired())</span>
+ {
+<span class="fc" id="L626"> expectedOpts.remove(option.getKey());</span>
+ }
+
+ // if the option is in an OptionGroup make that option the selected option of the group
+<span class="fc bfc" id="L630" title="All 2 branches covered."> if (options.getOptionGroup(option) != null)</span>
+ {
+<span class="fc" id="L632"> OptionGroup group = options.getOptionGroup(option);</span>
+
+<span class="pc bpc" id="L634" title="1 of 2 branches missed."> if (group.isRequired())</span>
+ {
+<span class="nc" id="L636"> expectedOpts.remove(group);</span>
+ }
+
+<span class="fc" id="L639"> group.setSelected(option);</span>
+ }
+<span class="fc" id="L641"> }</span>
+
+ /**
+ * Breaks <code>token</code> into its constituent parts
+ * using the following algorithm.
+ *
+ * <ul>
+ * <li>ignore the first character ("<b>-</b>")</li>
+ * <li>foreach remaining character check if an {@link Option}
+ * exists with that id.</li>
+ * <li>if an {@link Option} does exist then add that character
+ * prepended with "<b>-</b>" to the list of processed tokens.</li>
+ * <li>if the {@link Option} can have an argument value and there
+ * are remaining characters in the token then add the remaining
+ * characters as a token to the list of processed tokens.</li>
+ * <li>if an {@link Option} does <b>NOT</b> exist <b>AND</b>
+ * <code>stopAtNonOption</code> <b>IS</b> set then add the special token
+ * "<b>--</b>" followed by the remaining characters and also
+ * the remaining tokens directly to the processed tokens list.</li>
+ * <li>if an {@link Option} does <b>NOT</b> exist <b>AND</b>
+ * <code>stopAtNonOption</code> <b>IS NOT</b> set then add that
+ * character prepended with "<b>-</b>".</li>
+ * </ul>
+ *
+ * @param token The current token to be <b>burst</b>
+ * at the first non-Option encountered.
+ * @throws ParseException if there are any problems encountered
+ * while parsing the command line token.
+ */
+ protected void handleConcatenatedOptions(String token) throws ParseException
+ {
+<span class="fc bfc" id="L672" title="All 2 branches covered."> for (int i = 1; i < token.length(); i++)</span>
+ {
+<span class="fc" id="L674"> String ch = String.valueOf(token.charAt(i));</span>
+
+<span class="fc bfc" id="L676" title="All 2 branches covered."> if (options.hasOption(ch))</span>
+ {
+<span class="fc" id="L678"> handleOption(options.getOption(ch));</span>
+
+<span class="fc bfc" id="L680" title="All 4 branches covered."> if (currentOption != null && token.length() != i + 1)</span>
+ {
+ // add the trail as an argument of the option
+<span class="fc" id="L683"> currentOption.addValueForProcessing(token.substring(i + 1));</span>
+<span class="fc" id="L684"> break;</span>
+ }
+ }
+ else
+ {
+<span class="pc bpc" id="L689" title="1 of 4 branches missed."> handleUnknownToken(stopAtNonOption && i > 1 ? token.substring(i) : token);</span>
+<span class="fc" id="L690"> break;</span>
+ }
+ }
+<span class="fc" id="L693"> }</span>
+}
+</pre><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span></div></body></html>
\ No newline at end of file
Propchange: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/DefaultParser.java.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/GnuParser.html
==============================================================================
--- websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/GnuParser.html (added)
+++ websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/GnuParser.html Sat May 9 18:19:15 2015
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>GnuParser</title><script type="text/javascript" src="../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons CLI</a> > <a href="index.html" class="el_package">org.apache.commons.cli</a> > <span class="el_class">GnuParser</span></div><h1>GnuParser</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" o
nclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">0 of 145</td><td class="ctr2">100%</td><td class="bar">0 of 20</td><td class="ctr2">100%</td><td class="ctr1">0</td><td class="ctr2">12</td><td class="ctr1">0</td><td class="ct
r2">28</td><td class="ctr1">0</td><td class="ctr2">2</td></tr></tfoot><tbody><tr><td id="a0"><a href="GnuParser.java.html#L53" class="el_method">flatten(Options, String[], boolean)</a></td><td class="bar" id="b0"><img src="../.resources/greenbar.gif" width="120" height="10" title="142" alt="142"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d0"><img src="../.resources/greenbar.gif" width="120" height="10" title="20" alt="20"/></td><td class="ctr2" id="e0">100%</td><td class="ctr1" id="f0">0</td><td class="ctr2" id="g0">11</td><td class="ctr1" id="h0">0</td><td class="ctr2" id="i0">27</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a1"><a href="GnuParser.java.html#L31" class="el_method">GnuParser()</a></td><td class="bar" id="b1"><img src="../.resources/greenbar.gif" width="2" height="10" title="3" alt="3"/></td><td class="ctr2" id="c1">100%</td><td class="bar" id="d1"/><td class="ctr2" id="e1">n/a</td><td class="ctr1" id="f1">0</td><t
d class="ctr2" id="g1">1</td><td class="ctr1" id="h1">0</td><td class="ctr2" id="i1">1</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span></div></body></html>
\ No newline at end of file
Propchange: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/GnuParser.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/GnuParser.java.html
==============================================================================
--- websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/GnuParser.java.html (added)
+++ websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/GnuParser.java.html Sat May 9 18:19:15 2015
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>GnuParser.java</title><link rel="stylesheet" href="../.resources/prettify.css" type="text/css"/><script type="text/javascript" src="../.resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons CLI</a> > <a href="index.source.html" class="el_package">org.apache.commons.cli</a> > <span class="el_source">GnuParser.java</span></div><h1>GnuPar
ser.java</h1><pre class="source lang-java linenums">/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.cli;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * The class GnuParser provides an implementation of the
+ * {@link Parser#flatten(Options, String[], boolean) flatten} method.
+ *
+ * @version $Id: GnuParser.java 1445352 2013-02-12 20:48:19Z tn $
+ * @deprecated since 1.3, use the {@link DefaultParser} instead
+ */
+@Deprecated
+<span class="fc" id="L31">public class GnuParser extends Parser</span>
+{
+ /**
+ * This flatten method does so using the following rules:
+ * <ol>
+ * <li>If an {@link Option} exists for the first character of
+ * the <code>arguments</code> entry <b>AND</b> an {@link Option}
+ * does not exist for the whole <code>argument</code> then
+ * add the first character as an option to the processed tokens
+ * list e.g. "-D" and add the rest of the entry to the also.</li>
+ * <li>Otherwise just add the token to the processed tokens list.</li>
+ * </ol>
+ *
+ * @param options The Options to parse the arguments by.
+ * @param arguments The arguments that have to be flattened.
+ * @param stopAtNonOption specifies whether to stop flattening when
+ * a non option has been encountered
+ * @return a String array of the flattened arguments
+ */
+ @Override
+ protected String[] flatten(Options options, String[] arguments, boolean stopAtNonOption)
+ {
+<span class="fc" id="L53"> List<String> tokens = new ArrayList<String>();</span>
+
+<span class="fc" id="L55"> boolean eatTheRest = false;</span>
+
+<span class="fc bfc" id="L57" title="All 2 branches covered."> for (int i = 0; i < arguments.length; i++)</span>
+ {
+<span class="fc" id="L59"> String arg = arguments[i];</span>
+
+<span class="fc bfc" id="L61" title="All 2 branches covered."> if ("--".equals(arg))</span>
+ {
+<span class="fc" id="L63"> eatTheRest = true;</span>
+<span class="fc" id="L64"> tokens.add("--");</span>
+ }
+<span class="fc bfc" id="L66" title="All 2 branches covered."> else if ("-".equals(arg))</span>
+ {
+<span class="fc" id="L68"> tokens.add("-");</span>
+ }
+<span class="fc bfc" id="L70" title="All 2 branches covered."> else if (arg.startsWith("-"))</span>
+ {
+<span class="fc" id="L72"> String opt = Util.stripLeadingHyphens(arg);</span>
+
+<span class="fc bfc" id="L74" title="All 2 branches covered."> if (options.hasOption(opt))</span>
+ {
+<span class="fc" id="L76"> tokens.add(arg);</span>
+ }
+ else
+ {
+<span class="fc bfc" id="L80" title="All 4 branches covered."> if (opt.indexOf('=') != -1 && options.hasOption(opt.substring(0, opt.indexOf('='))))</span>
+ {
+ // the format is --foo=value or -foo=value
+<span class="fc" id="L83"> tokens.add(arg.substring(0, arg.indexOf('='))); // --foo</span>
+<span class="fc" id="L84"> tokens.add(arg.substring(arg.indexOf('=') + 1)); // value</span>
+ }
+<span class="fc bfc" id="L86" title="All 2 branches covered."> else if (options.hasOption(arg.substring(0, 2)))</span>
+ {
+ // the format is a special properties option (-Dproperty=value)
+<span class="fc" id="L89"> tokens.add(arg.substring(0, 2)); // -D</span>
+<span class="fc" id="L90"> tokens.add(arg.substring(2)); // property=value</span>
+ }
+ else
+ {
+<span class="fc" id="L94"> eatTheRest = stopAtNonOption;</span>
+<span class="fc" id="L95"> tokens.add(arg);</span>
+ }
+ }
+<span class="fc" id="L98"> }</span>
+ else
+ {
+<span class="fc" id="L101"> tokens.add(arg);</span>
+ }
+
+<span class="fc bfc" id="L104" title="All 2 branches covered."> if (eatTheRest)</span>
+ {
+<span class="fc bfc" id="L106" title="All 2 branches covered."> for (i++; i < arguments.length; i++) //NOPMD</span>
+ {
+<span class="fc" id="L108"> tokens.add(arguments[i]);</span>
+ }
+ }
+ }
+
+<span class="fc" id="L113"> return tokens.toArray(new String[tokens.size()]);</span>
+ }
+}
+</pre><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span></div></body></html>
\ No newline at end of file
Propchange: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/GnuParser.java.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/HelpFormatter$OptionComparator.html
==============================================================================
--- websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/HelpFormatter$OptionComparator.html (added)
+++ websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/HelpFormatter$OptionComparator.html Sat May 9 18:19:15 2015
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>HelpFormatter.OptionComparator</title><script type="text/javascript" src="../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons CLI</a> > <a href="index.html" class="el_package">org.apache.commons.cli</a> > <span class="el_class">HelpFormatter.OptionComparator</span></div><h1>HelpFormatter.OptionComparator</h1><table class="coverage" cellspacing=
"0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">0 of 9</td><td class="ctr2">100%</td><td class="bar">0 of 0</td><td class="ctr2">n/a</td><td class="ctr1">0</td><
td class="ctr2">2</td><td class="ctr1">0</td><td class="ctr2">2</td><td class="ctr1">0</td><td class="ctr2">2</td></tr></tfoot><tbody><tr><td id="a0"><a href="HelpFormatter.java.html#L1090" class="el_method">compare(Option, Option)</a></td><td class="bar" id="b0"><img src="../.resources/greenbar.gif" width="120" height="10" title="6" alt="6"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d0"/><td class="ctr2" id="e0">n/a</td><td class="ctr1" id="f0">0</td><td class="ctr2" id="g0">1</td><td class="ctr1" id="h0">0</td><td class="ctr2" id="i0">1</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a1"><a href="HelpFormatter.java.html#L1072" class="el_method">HelpFormatter.OptionComparator()</a></td><td class="bar" id="b1"><img src="../.resources/greenbar.gif" width="60" height="10" title="3" alt="3"/></td><td class="ctr2" id="c1">100%</td><td class="bar" id="d1"/><td class="ctr2" id="e1">n/a</td><td class="ctr1" id="f1">0</td><td class="ctr2"
id="g1">1</td><td class="ctr1" id="h1">0</td><td class="ctr2" id="i1">1</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span></div></body></html>
\ No newline at end of file
Propchange: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/HelpFormatter$OptionComparator.html
------------------------------------------------------------------------------
svn:eol-style = native