<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_202) on Sat Apr 06 19:36:16 JST 2019 --> <title>CommandLine.ParseResult (picocli 3.9.6 API)</title> <meta name="date" content="2019-04-06"> <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> <script type="text/javascript" src="../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="CommandLine.ParseResult (picocli 3.9.6 API)"; } } catch(err) { } //--> var methods = {"i0":10,"i1":9,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../deprecated-list.html">Deprecated</a></li> <li><a href="../index-all.html">Index</a></li> <li><a href="../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../picocli/CommandLine.ParentCommand.html" title="annotation in picocli"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../picocli/CommandLine.ParseResult.Builder.html" title="class in picocli"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../index.html?picocli/CommandLine.ParseResult.html" target="_top">Frames</a></li> <li><a href="CommandLine.ParseResult.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li><a href="#nested.class.summary">Nested</a> | </li> <li>Field | </li> <li>Constr | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li>Constr | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">picocli</div> <h2 title="Class CommandLine.ParseResult" class="title">Class CommandLine.ParseResult</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>picocli.CommandLine.ParseResult</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Enclosing class:</dt> <dd><a href="../picocli/CommandLine.html" title="class in picocli">CommandLine</a></dd> </dl> <hr> <br> <pre>public static class <span class="typeNameLabel">CommandLine.ParseResult</span> extends java.lang.Object</pre> <div class="block">Encapsulates the result of parsing an array of command line arguments.</div> <dl> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>3.0</dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== NESTED CLASS SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="nested.class.summary"> <!-- --> </a> <h3>Nested Class Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation"> <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static class </code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.Builder.html" title="class in picocli">CommandLine.ParseResult.Builder</a></span></code> <div class="block">Builds immutable <code>ParseResult</code> instances.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>java.util.List<<a href="../picocli/CommandLine.html" title="class in picocli">CommandLine</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#asCommandLineList--">asCommandLineList</a></span>()</code> <div class="block">Returns this <code>ParseResult</code> as a list of <code>CommandLine</code> objects, one for each matched command/subcommand.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>static <a href="../picocli/CommandLine.ParseResult.Builder.html" title="class in picocli">CommandLine.ParseResult.Builder</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#builder-picocli.CommandLine.Model.CommandSpec-">builder</a></span>(<a href="../picocli/CommandLine.Model.CommandSpec.html" title="class in picocli">CommandLine.Model.CommandSpec</a> commandSpec)</code> <div class="block">Creates and returns a new <code>ParseResult.Builder</code> for the specified command spec.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code><a href="../picocli/CommandLine.Model.CommandSpec.html" title="class in picocli">CommandLine.Model.CommandSpec</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#commandSpec--">commandSpec</a></span>()</code> <div class="block">Returns the <code>CommandSpec</code> for the matched command.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code>java.util.List<java.lang.Exception></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#errors--">errors</a></span>()</code> <div class="block">If <a href="../picocli/CommandLine.Model.ParserSpec.html#collectErrors"><code>CommandLine.Model.ParserSpec.collectErrors</code></a> is <code>true</code>, returns the list of exceptions that were encountered during parsing, otherwise, returns an empty list.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#hasMatchedOption-char-">hasMatchedOption</a></span>(char shortName)</code> <div class="block">Returns whether an option whose aliases include the specified short name was matched on the command line.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#hasMatchedOption-picocli.CommandLine.Model.OptionSpec-">hasMatchedOption</a></span>(<a href="../picocli/CommandLine.Model.OptionSpec.html" title="class in picocli">CommandLine.Model.OptionSpec</a> option)</code> <div class="block">Returns whether the specified option was matched on the command line.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#hasMatchedOption-java.lang.String-">hasMatchedOption</a></span>(java.lang.String name)</code> <div class="block">Returns whether an option whose aliases include the specified name was matched on the command line.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#hasMatchedPositional-picocli.CommandLine.Model.PositionalParamSpec-">hasMatchedPositional</a></span>(<a href="../picocli/CommandLine.Model.PositionalParamSpec.html" title="class in picocli">CommandLine.Model.PositionalParamSpec</a> positional)</code> <div class="block">Returns whether the specified positional parameter was matched on the command line.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#hasMatchedPositional-int-">hasMatchedPositional</a></span>(int position)</code> <div class="block">Returns whether a positional parameter was matched at the specified position.</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#hasSubcommand--">hasSubcommand</a></span>()</code> <div class="block">Returns <code>true</code> if a subcommand was matched on the command line, <code>false</code> otherwise.</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#isUsageHelpRequested--">isUsageHelpRequested</a></span>()</code> <div class="block">Returns <code>true</code> if one of the options that was matched on the command line is a <a href="../picocli/CommandLine.Model.OptionSpec.html#usageHelp--"><code>usageHelp</code></a> option.</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#isVersionHelpRequested--">isVersionHelpRequested</a></span>()</code> <div class="block">Returns <code>true</code> if one of the options that was matched on the command line is a <a href="../picocli/CommandLine.Model.OptionSpec.html#versionHelp--"><code>versionHelp</code></a> option.</div> </td> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><code><a href="../picocli/CommandLine.Model.OptionSpec.html" title="class in picocli">CommandLine.Model.OptionSpec</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#matchedOption-char-">matchedOption</a></span>(char shortName)</code> <div class="block">Returns the option with the specified short name, or <code>null</code> if no option with that name was matched on the command line.</div> </td> </tr> <tr id="i13" class="rowColor"> <td class="colFirst"><code><a href="../picocli/CommandLine.Model.OptionSpec.html" title="class in picocli">CommandLine.Model.OptionSpec</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#matchedOption-java.lang.String-">matchedOption</a></span>(java.lang.String name)</code> <div class="block">Returns the option with the specified name, or <code>null</code> if no option with that name was matched on the command line.</div> </td> </tr> <tr id="i14" class="altColor"> <td class="colFirst"><code>java.util.List<<a href="../picocli/CommandLine.Model.OptionSpec.html" title="class in picocli">CommandLine.Model.OptionSpec</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#matchedOptions--">matchedOptions</a></span>()</code> <div class="block">Returns a list of matched options, in the order they were found on the command line.</div> </td> </tr> <tr id="i15" class="rowColor"> <td class="colFirst"><code><T> T</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#matchedOptionValue-char-T-">matchedOptionValue</a></span>(char shortName, T defaultValue)</code> <div class="block">Returns the command line argument value of the option with the specified name, converted to the <a href="../picocli/CommandLine.Model.ArgSpec.html#type--">type</a> of the option, or the specified default value if no option with the specified name was matched.</div> </td> </tr> <tr id="i16" class="altColor"> <td class="colFirst"><code><T> T</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#matchedOptionValue-java.lang.String-T-">matchedOptionValue</a></span>(java.lang.String name, T defaultValue)</code> <div class="block">Returns the command line argument value of the option with the specified name, converted to the <a href="../picocli/CommandLine.Model.ArgSpec.html#type--">type</a> of the option, or the specified default value if no option with the specified name was matched.</div> </td> </tr> <tr id="i17" class="rowColor"> <td class="colFirst"><code><a href="../picocli/CommandLine.Model.PositionalParamSpec.html" title="class in picocli">CommandLine.Model.PositionalParamSpec</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#matchedPositional-int-">matchedPositional</a></span>(int position)</code> <div class="block">Returns the first <code>PositionalParamSpec</code> that matched an argument at the specified position, or <code>null</code> if no positional parameters were matched at that position.</div> </td> </tr> <tr id="i18" class="altColor"> <td class="colFirst"><code>java.util.List<<a href="../picocli/CommandLine.Model.PositionalParamSpec.html" title="class in picocli">CommandLine.Model.PositionalParamSpec</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#matchedPositionals--">matchedPositionals</a></span>()</code> <div class="block">Returns a list of matched positional parameters.</div> </td> </tr> <tr id="i19" class="rowColor"> <td class="colFirst"><code>java.util.List<<a href="../picocli/CommandLine.Model.PositionalParamSpec.html" title="class in picocli">CommandLine.Model.PositionalParamSpec</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#matchedPositionals-int-">matchedPositionals</a></span>(int position)</code> <div class="block">Returns all <code>PositionalParamSpec</code> objects that matched an argument at the specified position, or an empty list if no positional parameters were matched at that position.</div> </td> </tr> <tr id="i20" class="altColor"> <td class="colFirst"><code><T> T</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#matchedPositionalValue-int-T-">matchedPositionalValue</a></span>(int position, T defaultValue)</code> <div class="block">Returns the command line argument value of the positional parameter at the specified position, converted to the <a href="../picocli/CommandLine.Model.ArgSpec.html#type--">type</a> of the positional parameter, or the specified default value if no positional parameter was matched at that position.</div> </td> </tr> <tr id="i21" class="rowColor"> <td class="colFirst"><code>java.util.List<java.lang.String></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#originalArgs--">originalArgs</a></span>()</code> <div class="block">Returns the command line arguments that were parsed.</div> </td> </tr> <tr id="i22" class="altColor"> <td class="colFirst"><code><a href="../picocli/CommandLine.ParseResult.html" title="class in picocli">CommandLine.ParseResult</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#subcommand--">subcommand</a></span>()</code> <div class="block">Returns the <code>ParseResult</code> for the subcommand of this command that was matched on the command line, or <code>null</code> if no subcommand was matched.</div> </td> </tr> <tr id="i23" class="rowColor"> <td class="colFirst"><code>java.util.List<java.lang.String></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../picocli/CommandLine.ParseResult.html#unmatched--">unmatched</a></span>()</code> <div class="block">Returns a list of command line arguments that did not match any options or positional parameters.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="builder-picocli.CommandLine.Model.CommandSpec-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>builder</h4> <pre>public static <a href="../picocli/CommandLine.ParseResult.Builder.html" title="class in picocli">CommandLine.ParseResult.Builder</a> builder(<a href="../picocli/CommandLine.Model.CommandSpec.html" title="class in picocli">CommandLine.Model.CommandSpec</a> commandSpec)</pre> <div class="block">Creates and returns a new <code>ParseResult.Builder</code> for the specified command spec.</div> </li> </ul> <a name="matchedOption-char-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>matchedOption</h4> <pre>public <a href="../picocli/CommandLine.Model.OptionSpec.html" title="class in picocli">CommandLine.Model.OptionSpec</a> matchedOption(char shortName)</pre> <div class="block">Returns the option with the specified short name, or <code>null</code> if no option with that name was matched on the command line. <p>Use <a href="../picocli/CommandLine.Model.ArgSpec.html#getValue--"><code>getValue</code></a> on the returned <code>OptionSpec</code> to get the matched value (or values), converted to the type of the option. Alternatively, use <a href="../picocli/CommandLine.Model.ArgSpec.html#stringValues--"><code>stringValues</code></a> to get the matched String values after they were <a href="../picocli/CommandLine.Model.ArgSpec.html#splitRegex--">split</a> into parts, or <a href="../picocli/CommandLine.Model.ArgSpec.html#originalStringValues--"><code>originalStringValues</code></a> to get the original String values that were matched on the command line, before any processing. </p><p>To get the <a href="../picocli/CommandLine.Model.ArgSpec.html#defaultValue--">default value</a> of an option that was <a href="../picocli/CommandLine.ParseResult.html#hasMatchedOption-char-"><em>not</em> matched</a> on the command line, use <code>parseResult.commandSpec().findOption(shortName).getValue()</code>. </p></div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../picocli/CommandLine.Model.CommandSpec.html#findOption-char-"><code>CommandLine.Model.CommandSpec.findOption(char)</code></a></dd> </dl> </li> </ul> <a name="matchedOption-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>matchedOption</h4> <pre>public <a href="../picocli/CommandLine.Model.OptionSpec.html" title="class in picocli">CommandLine.Model.OptionSpec</a> matchedOption(java.lang.String name)</pre> <div class="block">Returns the option with the specified name, or <code>null</code> if no option with that name was matched on the command line. <p>Use <a href="../picocli/CommandLine.Model.ArgSpec.html#getValue--"><code>getValue</code></a> on the returned <code>OptionSpec</code> to get the matched value (or values), converted to the type of the option. Alternatively, use <a href="../picocli/CommandLine.Model.ArgSpec.html#stringValues--"><code>stringValues</code></a> to get the matched String values after they were <a href="../picocli/CommandLine.Model.ArgSpec.html#splitRegex--">split</a> into parts, or <a href="../picocli/CommandLine.Model.ArgSpec.html#originalStringValues--"><code>originalStringValues</code></a> to get the original String values that were matched on the command line, before any processing. </p><p>To get the <a href="../picocli/CommandLine.Model.ArgSpec.html#defaultValue--">default value</a> of an option that was <a href="../picocli/CommandLine.ParseResult.html#hasMatchedOption-java.lang.String-"><em>not</em> matched</a> on the command line, use <code>parseResult.commandSpec().findOption(String).getValue()</code>. </p></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>name</code> - used to search the matched options. May be an alias of the option name that was actually specified on the command line. The specified name may include option name prefix characters or not.</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../picocli/CommandLine.Model.CommandSpec.html#findOption-java.lang.String-"><code>CommandLine.Model.CommandSpec.findOption(String)</code></a></dd> </dl> </li> </ul> <a name="matchedPositional-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>matchedPositional</h4> <pre>public <a href="../picocli/CommandLine.Model.PositionalParamSpec.html" title="class in picocli">CommandLine.Model.PositionalParamSpec</a> matchedPositional(int position)</pre> <div class="block">Returns the first <code>PositionalParamSpec</code> that matched an argument at the specified position, or <code>null</code> if no positional parameters were matched at that position.</div> </li> </ul> <a name="matchedPositionals-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>matchedPositionals</h4> <pre>public java.util.List<<a href="../picocli/CommandLine.Model.PositionalParamSpec.html" title="class in picocli">CommandLine.Model.PositionalParamSpec</a>> matchedPositionals(int position)</pre> <div class="block">Returns all <code>PositionalParamSpec</code> objects that matched an argument at the specified position, or an empty list if no positional parameters were matched at that position.</div> </li> </ul> <a name="commandSpec--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>commandSpec</h4> <pre>public <a href="../picocli/CommandLine.Model.CommandSpec.html" title="class in picocli">CommandLine.Model.CommandSpec</a> commandSpec()</pre> <div class="block">Returns the <code>CommandSpec</code> for the matched command.</div> </li> </ul> <a name="hasMatchedOption-char-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>hasMatchedOption</h4> <pre>public boolean hasMatchedOption(char shortName)</pre> <div class="block">Returns whether an option whose aliases include the specified short name was matched on the command line.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>shortName</code> - used to search the matched options. May be an alias of the option name that was actually specified on the command line.</dd> </dl> </li> </ul> <a name="hasMatchedOption-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>hasMatchedOption</h4> <pre>public boolean hasMatchedOption(java.lang.String name)</pre> <div class="block">Returns whether an option whose aliases include the specified name was matched on the command line.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>name</code> - used to search the matched options. May be an alias of the option name that was actually specified on the command line. The specified name may include option name prefix characters or not.</dd> </dl> </li> </ul> <a name="hasMatchedOption-picocli.CommandLine.Model.OptionSpec-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>hasMatchedOption</h4> <pre>public boolean hasMatchedOption(<a href="../picocli/CommandLine.Model.OptionSpec.html" title="class in picocli">CommandLine.Model.OptionSpec</a> option)</pre> <div class="block">Returns whether the specified option was matched on the command line.</div> </li> </ul> <a name="hasMatchedPositional-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>hasMatchedPositional</h4> <pre>public boolean hasMatchedPositional(int position)</pre> <div class="block">Returns whether a positional parameter was matched at the specified position.</div> </li> </ul> <a name="hasMatchedPositional-picocli.CommandLine.Model.PositionalParamSpec-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>hasMatchedPositional</h4> <pre>public boolean hasMatchedPositional(<a href="../picocli/CommandLine.Model.PositionalParamSpec.html" title="class in picocli">CommandLine.Model.PositionalParamSpec</a> positional)</pre> <div class="block">Returns whether the specified positional parameter was matched on the command line.</div> </li> </ul> <a name="matchedOptions--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>matchedOptions</h4> <pre>public java.util.List<<a href="../picocli/CommandLine.Model.OptionSpec.html" title="class in picocli">CommandLine.Model.OptionSpec</a>> matchedOptions()</pre> <div class="block">Returns a list of matched options, in the order they were found on the command line.</div> </li> </ul> <a name="matchedPositionals--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>matchedPositionals</h4> <pre>public java.util.List<<a href="../picocli/CommandLine.Model.PositionalParamSpec.html" title="class in picocli">CommandLine.Model.PositionalParamSpec</a>> matchedPositionals()</pre> <div class="block">Returns a list of matched positional parameters.</div> </li> </ul> <a name="unmatched--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>unmatched</h4> <pre>public java.util.List<java.lang.String> unmatched()</pre> <div class="block">Returns a list of command line arguments that did not match any options or positional parameters.</div> </li> </ul> <a name="originalArgs--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>originalArgs</h4> <pre>public java.util.List<java.lang.String> originalArgs()</pre> <div class="block">Returns the command line arguments that were parsed.</div> </li> </ul> <a name="errors--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>errors</h4> <pre>public java.util.List<java.lang.Exception> errors()</pre> <div class="block">If <a href="../picocli/CommandLine.Model.ParserSpec.html#collectErrors"><code>CommandLine.Model.ParserSpec.collectErrors</code></a> is <code>true</code>, returns the list of exceptions that were encountered during parsing, otherwise, returns an empty list.</div> <dl> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>3.2</dd> </dl> </li> </ul> <a name="matchedOptionValue-char-java.lang.Object-"> <!-- --> </a><a name="matchedOptionValue-char-T-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>matchedOptionValue</h4> <pre>public <T> T matchedOptionValue(char shortName, T defaultValue)</pre> <div class="block">Returns the command line argument value of the option with the specified name, converted to the <a href="../picocli/CommandLine.Model.ArgSpec.html#type--">type</a> of the option, or the specified default value if no option with the specified name was matched.</div> </li> </ul> <a name="matchedOptionValue-java.lang.String-java.lang.Object-"> <!-- --> </a><a name="matchedOptionValue-java.lang.String-T-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>matchedOptionValue</h4> <pre>public <T> T matchedOptionValue(java.lang.String name, T defaultValue)</pre> <div class="block">Returns the command line argument value of the option with the specified name, converted to the <a href="../picocli/CommandLine.Model.ArgSpec.html#type--">type</a> of the option, or the specified default value if no option with the specified name was matched.</div> </li> </ul> <a name="matchedPositionalValue-int-java.lang.Object-"> <!-- --> </a><a name="matchedPositionalValue-int-T-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>matchedPositionalValue</h4> <pre>public <T> T matchedPositionalValue(int position, T defaultValue)</pre> <div class="block">Returns the command line argument value of the positional parameter at the specified position, converted to the <a href="../picocli/CommandLine.Model.ArgSpec.html#type--">type</a> of the positional parameter, or the specified default value if no positional parameter was matched at that position.</div> </li> </ul> <a name="hasSubcommand--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>hasSubcommand</h4> <pre>public boolean hasSubcommand()</pre> <div class="block">Returns <code>true</code> if a subcommand was matched on the command line, <code>false</code> otherwise.</div> </li> </ul> <a name="subcommand--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>subcommand</h4> <pre>public <a href="../picocli/CommandLine.ParseResult.html" title="class in picocli">CommandLine.ParseResult</a> subcommand()</pre> <div class="block">Returns the <code>ParseResult</code> for the subcommand of this command that was matched on the command line, or <code>null</code> if no subcommand was matched.</div> </li> </ul> <a name="isUsageHelpRequested--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isUsageHelpRequested</h4> <pre>public boolean isUsageHelpRequested()</pre> <div class="block">Returns <code>true</code> if one of the options that was matched on the command line is a <a href="../picocli/CommandLine.Model.OptionSpec.html#usageHelp--"><code>usageHelp</code></a> option.</div> </li> </ul> <a name="isVersionHelpRequested--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isVersionHelpRequested</h4> <pre>public boolean isVersionHelpRequested()</pre> <div class="block">Returns <code>true</code> if one of the options that was matched on the command line is a <a href="../picocli/CommandLine.Model.OptionSpec.html#versionHelp--"><code>versionHelp</code></a> option.</div> </li> </ul> <a name="asCommandLineList--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>asCommandLineList</h4> <pre>public java.util.List<<a href="../picocli/CommandLine.html" title="class in picocli">CommandLine</a>> asCommandLineList()</pre> <div class="block">Returns this <code>ParseResult</code> as a list of <code>CommandLine</code> objects, one for each matched command/subcommand. For backwards compatibility with pre-3.0 methods.</div> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../deprecated-list.html">Deprecated</a></li> <li><a href="../index-all.html">Index</a></li> <li><a href="../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../picocli/CommandLine.ParentCommand.html" title="annotation in picocli"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../picocli/CommandLine.ParseResult.Builder.html" title="class in picocli"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../index.html?picocli/CommandLine.ParseResult.html" target="_top">Frames</a></li> <li><a href="CommandLine.ParseResult.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li><a href="#nested.class.summary">Nested</a> | </li> <li>Field | </li> <li>Constr | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li>Constr | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>