Skip to content

Commit dccd0a1

Browse files
committed
completion (feature): dart cli
1 parent c8ef6c9 commit dccd0a1

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

clean_files.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ completion/available/cargo.completion.bash
6767
completion/available/composer.completion.bash
6868
completion/available/conda.completion.bash
6969
completion/available/consul.completion.bash
70+
completion/available/dart.completion.bash
7071
completion/available/django.completion.bash
7172
completion/available/docker.completion.bash
7273
completion/available/docker-machine.completion.bash
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# shellcheck shell=bash
2+
3+
__dart_completion() {
4+
local prev=$(_get_pword)
5+
local curr=$(_get_cword)
6+
7+
local HELP="--help -h"
8+
local VERBOSE="-v --verbose"
9+
local DEFAULT="$BASE --authtoken --region"
10+
11+
case $prev in
12+
analyze)
13+
# shellcheck disable=SC2207
14+
COMPREPLY=($(compgen -W "$HELP --fatal-infos --no-fatal-warnings --fatal-warnings" -- "$curr"))
15+
;;
16+
compile)
17+
# shellcheck disable=SC2207
18+
COMPREPLY=($(compgen -W "$HELP aot-snapshot exe js jit-snapshot kernel" -- "$curr"))
19+
;;
20+
create)
21+
# shellcheck disable=SC2207
22+
COMPREPLY=($(compgen -W "$HELP --template -t --no-pub --pub --force" -- "$curr"))
23+
;;
24+
-t | --template)
25+
# shellcheck disable=SC2207
26+
COMPREPLY=($(compgen -W "console-simple console-full package-simple web-simple" -- "$curr"))
27+
;;
28+
format)
29+
# shellcheck disable=SC2207
30+
COMPREPLY=($(compgen -W "$HELP $VERBOSE -o --output --fix -l --line-length" -- "$curr"))
31+
;;
32+
pub)
33+
# shellcheck disable=SC2207
34+
COMPREPLY=($(compgen -W "$HELP $VERBOSE --version --no-trace --trace --verbosity cache deps downgrade get global logout outdated publish run upgrade uploader version" -- "$curr"))
35+
;;
36+
run)
37+
# shellcheck disable=SC2207
38+
COMPREPLY=($(compgen -W "$HELP --observe --enable-vm-service --no-pause-isolates-on-exit --no-pause-isolates-on-unhandled-exceptions --no-warn-on-pause-with-no-debugger --pause-isolates-on-exit --pause-isolates-on-unhandled-exceptions --warn-on-pause-with-no-debugger" -- "$curr"))
39+
;;
40+
*)
41+
# shellcheck disable=SC2207
42+
COMPREPLY=($(compgen -W "$HELP $VERBOSE --version --enable-analytics --disable-analytics help analyze compile create format pub run test" -- "$curr"))
43+
;;
44+
esac
45+
}
46+
47+
complete -F __dart_completion dart

0 commit comments

Comments
 (0)