From 3cb4b94706a16c30d151bb3279963384cb382f51 Mon Sep 17 00:00:00 2001 From: Ary Borenszweig Date: Sat, 6 Jan 2018 15:17:23 -0300 Subject: [PATCH] CLI: remove deps command (#5544) --- etc/completion.bash | 15 +-------------- etc/completion.zsh | 13 ------------- man/crystal.1 | 11 ++--------- src/compiler/crystal/command.cr | 5 ++--- src/compiler/crystal/command/deps.cr | 14 -------------- 5 files changed, 5 insertions(+), 53 deletions(-) delete mode 100644 src/compiler/crystal/command/deps.cr diff --git a/etc/completion.bash b/etc/completion.bash index ab392235c830..a50a7801b3d7 100644 --- a/etc/completion.bash +++ b/etc/completion.bash @@ -14,7 +14,7 @@ _crystal() local cur="${COMP_WORDS[COMP_CWORD]}" local prev="${COMP_WORDS[COMP_CWORD-1]}" - commands="init build deps docs eval play run spec tool help version --help --version" + commands="init build docs eval play run spec tool help version --help --version" case "${cmd}" in init) @@ -32,19 +32,6 @@ _crystal() COMPREPLY=($(_crystal_compgen_files $cur)) fi ;; - deps) - if [[ ${cur} == -* ]] ; then - local opts="--no-color --version --production" - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) - else - if [[ "${prev}" == "deps" ]] ; then - local subcommands="check install list update" - COMPREPLY=( $(compgen -W "${subcommands}" -- ${cur}) ) - else - COMPREPLY=($(_crystal_compgen_files $cur)) - fi - fi - ;; run) if [[ ${cur} == -* ]] ; then local opts="--debug --define --emit --format --help --ll --link-flags --mcpu --no-color --no-codegen --prelude --release --stats --single-module --threads --verbose" diff --git a/etc/completion.zsh b/etc/completion.zsh index 5e56070f6928..ab06494e7e8b 100644 --- a/etc/completion.zsh +++ b/etc/completion.zsh @@ -7,7 +7,6 @@ _crystal_commands() { commands=( "init:generate new crystal project" "build:build an executable" - "deps:install project dependencies" "docs:generate documentation" "env:print Crystal environment information" "eval:eval code from args or standard input" @@ -100,18 +99,6 @@ _crystal-build() { && ret=0 } -_crystal-deps() { - _arguments \ - '1:type:(build check init install list prune update)' \ - $help_args \ - $no_color_args \ - '(--version)--version[version]' \ - '(--production)--production[production mode]' \ - '(-v --verbose)'{-v,--verbose}'[verbose mode]' \ - '(-q --quiet)'{-q,--quiet}'[quiet mode]' \ - && ret=0 -} - _crystal-env() { _arguments \ '(--help)--help[prints help]' \ diff --git a/man/crystal.1 b/man/crystal.1 index 9ed56fdcdddc..0429aa4543ab 100644 --- a/man/crystal.1 +++ b/man/crystal.1 @@ -56,11 +56,11 @@ The optimizations are not turned on by default because the compile times are muc .Bl -tag -width "12345678" -compact .Pp .Sh OPTIONS -The crystal command accepts the following options +The crystal command accepts the following options .Bl -tag -width "12345678" -compact .Pp -.It +.It .Cm init TYPE NAME @@ -141,13 +141,6 @@ Display the commands executed by the system. Source file name to be read from STDIN. .El -.Pp -.It -.Cm deps -.Op options -.Ar -.Pp -Alias for shards, the dependency manager for Crystal language. .Pp .It .Cm docs diff --git a/src/compiler/crystal/command.cr b/src/compiler/crystal/command.cr index f08cce6c8454..616541a611d5 100644 --- a/src/compiler/crystal/command.cr +++ b/src/compiler/crystal/command.cr @@ -18,7 +18,6 @@ class Crystal::Command Command: init generate a new project build build an executable - deps install project dependencies docs generate documentation env print Crystal environment information eval eval code from args or standard input @@ -72,8 +71,8 @@ class Crystal::Command options.shift playground when "deps".starts_with?(command) - options.shift - deps + STDERR.puts "Please use 'shards': 'crystal deps' has been removed" + exit 1 when "docs".starts_with?(command) options.shift docs diff --git a/src/compiler/crystal/command/deps.cr b/src/compiler/crystal/command/deps.cr deleted file mode 100644 index 03a324b32a38..000000000000 --- a/src/compiler/crystal/command/deps.cr +++ /dev/null @@ -1,14 +0,0 @@ -# Implementation of the `crystal deps` command, which -# simply delegates to the `shards` executable - -class Crystal::Command - private def deps - path_to_shards = `which shards`.chomp - if path_to_shards.empty? - error "`shards` executable is missing. Please install shards: https://github.com/crystal-lang/shards" - end - - status = Process.run(path_to_shards, args: options, output: Process::Redirect::Inherit, error: Process::Redirect::Inherit) - exit status.exit_code unless status.success? - end -end