Addem
Addem

Reputation: 3949

OCaml: Can't find version

When I enter ocaml --version it returns

/usr/bin/ocaml: unknown option '--version'.

I installed it using OPAM and ran the instructions

opam init eval $(opam env) eval opam env opam switch create 4.07.0

and everything seemed to go fine. Entering which ocaml returns a correct-looking path. And when entering a terminal session it seems to work fine. I don't see this error mentioned anywhere when I search for it.

Upvotes: 1

Views: 566

Answers (1)

glennsl
glennsl

Reputation: 29126

OCaml tools are weird and usually do not follow the POSIX guidelines of using double dashes for command line options. At this point probably for historic reasons and because the standard Arg module parses command line arguments this way. In any case, this will do the trick:

ocaml -version

Upvotes: 3

Related Questions