File tree 2 files changed +63
-0
lines changed 2 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,26 @@ Add the following to your bash or zsh profile for convenience:
95
95
alias ddev='pub run dart_dev'
96
96
```
97
97
98
+ #### Bash Completion
99
+
100
+ Symlink or copy the file ` tool/ddev-completion.sh ` into
101
+ ` /etc/bash_completion.d/ ` (or wherever your completion scripts live, if you
102
+ have installed Bash through Homebrew on a Mac, for instance, this will be
103
+ ` /usr/local/etc/bash_completion.d/ ` ).
104
+
105
+ If you are using Bash installed through Homebrew, you'll also need to install
106
+ the completion machinery with ` brew install bash-completion ` . Then make sure
107
+ something like the following is in your ` .bashrc ` file:
108
+
109
+ ```
110
+ if [ -f $(brew --prefix)/etc/bash_completion ]; then
111
+ . $(brew --prefix)/etc/bash_completion
112
+ fi
113
+ ```
114
+
115
+ Next time you load a Bash session you'll have basic completions for the ` ddev `
116
+ alias described above.
117
+
98
118
#### Configuration
99
119
In order to configure ` dart_dev ` for a specific project, run ` ddev init ` or
100
120
` pub run dart_dev init ` to generate the configuration file. This should create a
Original file line number Diff line number Diff line change
1
+ _ddev ()
2
+ {
3
+ local cur prev cmds
4
+
5
+ COMPREPLY=()
6
+
7
+ cur=" ${COMP_WORDS[COMP_CWORD]} "
8
+ prev=" ${COMP_WORDS[COMP_CWORD-1]} "
9
+ cmds=" --help --quiet --version --color --no-color analyze copy-license coverage docs examples format init test"
10
+
11
+ #
12
+ # Complete subcommand options instead of top-level commands and options.
13
+ #
14
+
15
+ if [[ " ${COMP_WORDS[*]} " == * " analyze " * ]]; then
16
+ cmds=" --help --fatal-warnings --no-fatal-warnings --hints --no-hints"
17
+ fi
18
+
19
+ if [[ " ${COMP_WORDS[*]} " == * " coverage " * ]]; then
20
+ cmds=" --help --unit --no-unit --integration --no-integration --html --no-html --open --no-open"
21
+ fi
22
+
23
+ if [[ " ${COMP_WORDS[*]} " == * " docs " * ]]; then
24
+ cmds=" --help --open --no-open"
25
+ fi
26
+
27
+ if [[ " ${COMP_WORDS[*]} " == * " examples " * ]]; then
28
+ cmds=" --help --hostname --port"
29
+ fi
30
+
31
+ if [[ " ${COMP_WORDS[*]} " == * " format " * ]]; then
32
+ cmds=" --help --check --line-length"
33
+ fi
34
+
35
+ if [[ " ${COMP_WORDS[*]} " == * " test " * ]]; then
36
+ cmds=" --help --unit --no-unit --integration --no-integration --concurrency --platform"
37
+ fi
38
+
39
+ COMPREPLY=($( compgen -W " ${cmds} " -- ${cur} ) )
40
+ return 0
41
+ }
42
+ complete -F _ddev ddev
43
+
You can’t perform that action at this time.
0 commit comments