Skip to content

Commit

Permalink
Rename the compile command to build. Fixes crystal-lang#502
Browse files Browse the repository at this point in the history
  • Loading branch information
Ary Borenszweig committed Jun 30, 2016
1 parent b1ef2bf commit bebdd56
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion etc/completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ _crystal()
local cur="${COMP_WORDS[COMP_CWORD]}"
local prev="${COMP_WORDS[COMP_CWORD-1]}"

commands="init compile deps docs eval play run spec tool help version --help --version"
commands="init build deps docs eval play run spec tool help version --help --version"

case "${cmd}" in
init)
Expand Down
4 changes: 2 additions & 2 deletions spec/compiler/compiler_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe "Compiler" do
tempfile = Tempfile.new "compiler_spec_output"
tempfile.close

Crystal::Command.run ["compile", "#{__DIR__}/data/compiler_sample", "-o", tempfile.path]
Crystal::Command.run ["build", "#{__DIR__}/data/compiler_sample", "-o", tempfile.path]

File.exists?(tempfile.path).should be_true

Expand All @@ -18,7 +18,7 @@ describe "Compiler" do
tempfile = Tempfile.new "compiler_spec_output"
tempfile.close

Crystal::Command.run ["compile", "#{__DIR__}/data/compiler_sample", "-o", tempfile.path]
Crystal::Command.run ["build", "#{__DIR__}/data/compiler_sample", "-o", tempfile.path]

File.exists?(tempfile.path).should be_true

Expand Down
16 changes: 8 additions & 8 deletions src/compiler/crystal/command.cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ class Crystal::Command
Command:
init generate a new project
compile compile program
build build an executable
deps install project dependencies
docs generate documentation
env print Crystal environment information
eval eval code from args or standard input
play starts crystal playground server
run (default) compile and run program
spec compile and run specs (in spec directory)
run (default) build and run program
spec build and run specs (in spec directory)
tool run a tool
help, --help, -h show this help
version, --version, -v show version
Expand Down Expand Up @@ -53,11 +53,11 @@ class Crystal::Command
options.shift
init
when "build".starts_with?(command), "compile".starts_with?(command)
if "build".starts_with?(command)
STDERR.puts "Deprecation: The build command was renamed to compile and will be removed in a future version."
if "compile".starts_with?(command)
STDERR.puts "Deprecation: The compile command was renamed to build and will be removed in a future version."
end
options.shift
compile
build
when "play".starts_with?(command)
options.shift
playground
Expand Down Expand Up @@ -155,8 +155,8 @@ class Crystal::Command
Init.run(options)
end

private def compile
config = create_compiler "compile"
private def build
config = create_compiler "build"
config.compile
end

Expand Down

0 comments on commit bebdd56

Please sign in to comment.