Welcome! Please see the About page for a little more info on how this works.

0 votes
in REPL by
Clojure should support the `--version` and `-v` switches that are nearly universal among software tools.  

Suggested output is EDN format:

  {:version {:clojure "1.10.1-beta1" :java "Java 12"}}

4 Answers

0 votes
by
_Comment made by: alexmiller_

If going the data route, {{*clojure-version\*}} already has a data format:
 

{:major 1, :minor 10, :incremental 0, :qualifier nil}


and Java has it's own equivalent buried in the Java system properties.

However, seems like first step is to consider whether the primary consumer of this is people or programs. It would be very useful for error reporting, but people would be fine for that. Programs can already emit data by using


clj -e "*clojure-version*"


etc.
0 votes
by

Comment made by: jafingerhut

It seems possibly useful, besides the Clojure and Java versions, to also report a version number for the clojure/clj program itself, which is independent of the other version numbers?

0 votes
by

Comment made by: alexmiller

We already have support for stuff like that in {{clj -Sdescribe}} and {{clj -Sverbose}}, so I'm going to say clj tool itself is out of scope here.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-2508 (reported by cloojure)
...