Skip to content

Commit

Permalink
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions etc/completion.bash
Original file line number Diff line number Diff line change
@@ -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 compile deps docs eval play run spec tool help version --help --version"

case "${cmd}" in
init)
@@ -24,7 +24,7 @@ _crystal()
COMPREPLY=( $(compgen -f ${cur}) )
fi
;;
build)
compile)
if [[ ${cur} == -* ]] ; then
local opts="--cross-compile --debug --emit --ll --link-flags --mcpu --no-color --no-codegen --prelude --release --single-module --threads --target --verbose --help"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
10 changes: 5 additions & 5 deletions etc/completion.zsh
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ _crystal_commands() {
local -a commands
commands=(
"init:generate new crystal project"
"build:compile program file"
"compile:compile program file"
"deps:install project dependencies"
"docs:generate documentation"
"eval:eval code"
@@ -29,7 +29,7 @@ local -a common_args; common_args=(
local -a programfile; programfile='*:Crystal File:_files -g "*.cr(.)"'

# TODO make 'emit' allow completion with more than one
local -a shared_run_build; shared_run_build=(
local -a shared_run_compile; shared_run_compile=(
$programfile \
$common_args \
'(--ll)-ll[Dump ll to .crystal directory]' \
@@ -53,9 +53,9 @@ _crystal-init() {
&& ret=0
}

_crystal-build() {
_crystal-compile() {
_arguments \
$shared_run_build \
$shared_run_compile \
'(--cross-compile)--cross-compile[cross-compile FLAGS]:' \
'(--target)--target[target triple]:' \
&& ret=0
@@ -70,7 +70,7 @@ _crystal-hierarchy() {

_crystal-run() {
_arguments \
$shared_run_build \
$shared_run_compile \
&& ret=0
}

0 comments on commit 51733de

Please sign in to comment.