榆树:如何只用榆树版一行?

时间:2016-05-28 07:25:21

标签: elm

如何使用elm版本获得一行?

现在我明白了:

$ elm-make --version
elm-make 0.17 (Elm Platform 0.17.0)

Usage: elm-make [FILES...] [--output FILE] [--yes] [--report FORMAT] [--warn]
                [--docs FILE] [--prepublish] [--prepublish-core]
  build Elm projects

Available options:
  -h,--help                Show this help text
  --output FILE            Write result to the given .html or .js FILE.
  --yes                    Reply 'yes' to all automated prompts.
  --report FORMAT          Format of error and warning reports (e.g.
                           --report=json)
  --warn                   Report warnings to improve code quality.
  --docs FILE              Write documentation to FILE as JSON.

Examples:
  elm-make Main.elm                     # compile to HTML in index.html
  elm-make Main.elm --output main.html  # compile to HTML in main.html
  elm-make Main.elm --output elm.js     # compile to JS in elm.js
  elm-make Main.elm --warn              # compile and report warnings

Full guide to using elm-make at <https://github.com/elm-lang/elm-make>
$

3 个答案:

答案 0 :(得分:4)

Elm Platform中的其他两个工具只打印版本(至少对我来说是OSX Elm 0.17.0):

% elm reactor --version
0.17.0
% elm repl --version
0.17.0

答案 1 :(得分:3)

elm-make --version 2>&1 | head -n 1

不确定重定向是否严格必要;在这种情况下,有些工具只是打印到stdout。

答案 2 :(得分:1)

从0.18.0版开始,普通的elm工具有效:

$ elm --version
0.18.0