Questions tagged [jcommander]

A java utility for CLI parameters parsing.

A java utility for CLI parameters parsing.

See http://jcommander.org/ for full details.

40 questions
1
vote
1 answer

Jcommander usage formatting

Hey I am using Jcommander library to parse command line arguments. My problem is with the format of the usage message generated by the Jcommander. This is the output of the usage function: Usage: mvnUploader [options] Options: * -d, --directory …
Ron Badur
  • 1,873
  • 2
  • 15
  • 34
1
vote
2 answers

Parsing command line with jCommander from Groovy (sample code fails)

I'm trying to use jCommander to parse command line parameters in Groovy. (MacBook (El Capitan), Groovy 2.4.11, jCommander-1.49 ) The example provided on jCommander.org (see http://jcommander.org/#_groovy) reads: import…
lexu
  • 8,766
  • 5
  • 45
  • 63
1
vote
0 answers

JLine Java program is not interactive via IntelJ console

I want to run a Java program via IntelJ, this program use Jcommander which enable it to get commands from the console and process it, the problem is that currently the console is not interactive meaning it opens the prompt but doesn't except any…
Oren Levi
  • 63
  • 7
1
vote
2 answers

jCommander - throw Exception for unknown and unused value?

I am working with JCommander 1.48, and i came across the following problem: For Example I have got these Parameters: @Parameter(names = "user", description = "the User") private String user; @Parameter(names = "password", description = "the…
leif_good
  • 376
  • 6
  • 19
1
vote
2 answers

JCommander parameter validation aware of other parameters

I'm using JCommander to parse command line params. I validate parameters using: public class SomeClass implements IParameterValidator { public void validate(String name, String value) throws ParameterException { ... } I ran into edge…
automatictester
  • 2,436
  • 1
  • 19
  • 34
1
vote
1 answer

validateWith is undefined for the annotation type Parameter (JCommander)

I get an error in Eclipse while trying a simple example with the JCommander package. The error says: The attribute validateWith is undefined for the annotation type Parameter and the code I'm using is the following: import…
Alby
  • 13
  • 6
1
vote
0 answers

Save parameters parsed by JCommander to file

Is it possible in JCommander to save class annotated with jcommander.Parameter to file, so one could create new object, using @ syntax to read from file? For example, if I have annotated class class IndexerCommandLineParameters { …
Skriptotajs
  • 844
  • 6
  • 15
0
votes
0 answers

java ClassNotFoundException : com.buest.jcommander.ParameterException

I'm using intellij and came across this error while running testNg. I verify 2 things: the class com.buest.jcommander.ParameterExeption exists under eternal libraries and jcommander path appears under project structure/modules. note: when I run…
batsheva
  • 1
  • 2
0
votes
1 answer

Was passed main parameter 'desc' but no main parameter was defined

I was receiving the below error, when a try to pass the jar parameters like: --order-by serialnumber, to_timestamp(startdate) desc com.beust.jcommander.ParameterException: Was passed main parameter 'desc' but no main parameter was defined
Paulo Moreira
  • 411
  • 5
  • 13
0
votes
1 answer

JCommander argument doesn't work in Docker ENTRYPOINT

I have a standard JCommander parameter which works fine when running the jar locally or through IntelliJ, but as soon as I try and load it through a dockerfile it returns: Exception in thread "main" com.beust.jcommander.ParameterException: Was…
Chris
  • 3,437
  • 6
  • 40
  • 73
0
votes
2 answers

How to use Array in JCommander in Scala

I want to use JCommander to parse args. I wrote some code: import com.beust.jcommander.{JCommander, Parameter} import scala.collection.mutable.ArrayBuffer object Config { @Parameter(names = Array("--categories"), required = true) var categories…
Makar Nikitin
  • 319
  • 1
  • 13
0
votes
1 answer

Does JCommander Support Dynamic Params With No Prefixes?

I am trying to port a CLI to use JCommander but my application allows for custom parameters to be passed on the command line like this: ./App.sh -u myusername -customparam1 customval1 In that case customparam1 is the name of the custom parameter…
Dave L.
  • 9,595
  • 7
  • 43
  • 69
0
votes
0 answers

Getting error in JCommander, java.lang.NoClassDefFoundError in java

Hey I am getting following complete error on my console, while trying to run my project. Exception in thread "main" java.lang.NoClassDefFoundError: com/beust/jcommander/JCommander at ro.uaic.info.VRPRunner.main(VRPRunner.java:42) Caused by:…
Shubham Singh
  • 90
  • 1
  • 8
0
votes
1 answer

When I run as TestNG, it's throwing Exception in thread main, but is running fine if it's ran as java application

I'm trying to run a basic TestNG class, but I'm getting this exception Exception in thread "main" com.beust.jcommander.ParameterException: Was passed main parameter '-d' but no main parameter was defined in your arg class If I give main() and try…
0
votes
1 answer

@Autowired entity is getting null

@Component public class TempTry implements CommandLineRunner{ @Autowired TokenRepository tkeRepo; @Parameter(names = { "--email", "-e" }) String email; static final Logger logger = LoggerFactory.getLogger(TempTry.class); @Override public void…
Dhanraj
  • 1,162
  • 4
  • 18
  • 45