[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Java question: How to query picard-tools for --version




----- Mail original -----
> De: "Andreas Tille" <andreas@an3as.eu>
> À: "Debian Med Project List" <debian-med@lists.debian.org>
> Envoyé: Jeudi 28 Juillet 2016 14:43:27
> Objet: Java question: How to query picard-tools for --version
> 
> Hi,
> 
> I'm struggling to package metaBIT[1] and I'm currently stumbling upon
> the fact that it is querying picard-tools for its version number.  While
> I could proably simply skip this test and make sure via dependencies
> that this is fullfilled I'd like to understand the issue myself.
> 
> When grepping picard-tools source there is a definition of --version
> option:
> 
> /picard-tools(master) $ grep -R -- "-version" | grep ^src
> src/main/resources/release_picard.sh:# java_version=`java -version 2>&1 |
> fgrep -i version`
> src/main/java/picard/cmdline/CommandLineParser.java:            {"--version",
> null, "Displays program version."}
> src/main/java/picard/cmdline/CommandLineParser.java:            if
> (arg.equals("--version")) {
> 
> 
> When trying
> 
>    /usr/bin/PicardCommandLine --version
> 
> I get
> 
> ...
> '--version' is not a valid command. See PicardCommandLine --help for more
> information.
> 
> 
> Funny enough also
> 
>    /usr/bin/PicardCommandLine --help
> 
> ends up in
> 
> ...
> '--help' is not a valid command. See PicardCommandLine --help for more
> information.
> 
> 
> When calling the command inside PicardCommandLine manually and add the
> specific
> class that contains the --version option
> 
> 
>    java -XX:MaxPermSize=256m -jar /usr/share/java/picard.jar
>    picard.cmdline.CommandLineParser --version
> 
> I get
> 
> ...
> 'picard.cmdline.CommandLineParser' is not a valid command. See
> PicardCommandLine --help for more information.
> 
> 
> I also tried
> 
>    ava  -classpath /usr/share/java/picard.jar
>    main=picard.cmdline.CommandLineParser --version
> Error: Could not find or load main class
> main=picard.cmdline.CommandLineParser
> 
> 
> So how can I successfully query for the picard-tools version.

--version is not used directly. PicardCommandLine accepts -h or a program name.

Then you can query --version for a specific program, example:


PicardCommandLine SortVcf --version


Olivier


> 
> Kind regards
> 
>        Andreas.
> 
> 
> [1] https://anonscm.debian.org/git/debian-med/metabit.git
> 
> --
> http://fam-tille.de
> 
> 


Reply to: