documentation bug, the documented example leads to: io.vertx.core.cli.MissingValueException: The option 'help' requires a value
Open
Nobody has claimed this yet.
invalid
- Dominant language
- Java
- Stars
- 39
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
when i use
addOption(new Option()
.setArgName("help")
.setShortName("h")
.setLongName("help"));
and type a command like
% shadowone -h
i get
io.vertx.core.cli.MissingValueException: The option 'help' requires a value
at io.vertx.core.cli.impl.DefaultParser.checkRequiredValues(DefaultParser.java:201)
at io.vertx.core.cli.impl.DefaultParser.parse(DefaultParser.java:125)
at io.vertx.core.cli.impl.DefaultParser.parse(DefaultParser.java:82)
at io.vertx.core.cli.impl.DefaultCLI.parse(DefaultCLI.java:47)
at io.vertx.core.cli.CLI$parse$3.call(Unknown Source)
at net.iowntheinter.cintershell.impl.cmds.example.TestOneShot$__clinit__closure1.doCall(TestOneShot.groovy:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1249)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1212)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:810)
at net.iowntheinter.cintershell.impl.commandOneShot.invokeMethod(commandOneShot.groovy)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:430)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:369)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
at net.iowntheinter.cintershell.impl.commandOneShot$_closure1.doCall(commandOneShot.groovy:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
at groovy.lang.Closure.call(Closure.java:426)
at org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:53)
at org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:105)
at com.sun.proxy.$Proxy13.handle(Unknown Source)
at io.vertx.ext.shell.command.impl.ProcessImpl.lambda$run$132(ProcessImpl.java:470)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$18(ContextImpl.java:335)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
at java.lang.Thread.run(Thread.java:745)
i believe it should work as described here:
http://vertx.io/docs/vertx-shell/java/#_command_arguments
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the documented addOption example and the command arguments documentation linked in the issue. Trace the reported failure through DefaultParser.checkRequiredValues in the stack trace, then verify the behavior of -h; done means the documented example behaves as described without requiring an argument.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100