branch_io_cli 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +32 -0
- data/lib/assets/completions/completion.bash +41 -0
- data/lib/assets/completions/completion.zsh +15 -0
- data/lib/branch_io_cli/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a59f8d672ea8d70c83d6bd2e23f1b56c1ace20f
|
4
|
+
data.tar.gz: 7a1367bb08e6e2bc1b9a496df9b79e9fd23cb0ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3e1dad4aa4a7e8481275f6c3032ffd71c1f7ab67ff3d8aea9601b09f78b13cc6727c74fbe85aa9301995a622cc8f9f1ba5de0773e7a89fe12214a288380d0b2
|
7
|
+
data.tar.gz: 597fc8f8ed4f486e97ac60858d145b16bc6c14de69698502cdfcb11d2c538da2c540c6b39f16c3610f7541251318a2b0fbf003ef64c49724437ef2a7d76283e3
|
data/README.md
CHANGED
@@ -30,6 +30,32 @@ branch_io setup -h
|
|
30
30
|
branch_io validate -h
|
31
31
|
```
|
32
32
|
|
33
|
+
### Shell completion
|
34
|
+
|
35
|
+
_Work in progress_
|
36
|
+
|
37
|
+
You can enable completion of all options in `bash` or `zsh`. The following
|
38
|
+
additions should follow initialization of RVM, rbenv or chruby or setting
|
39
|
+
any Ruby-related environment variables if using the system Ruby.
|
40
|
+
|
41
|
+
#### Bash
|
42
|
+
|
43
|
+
Add to `~/.bash_profile` or `~/.bashrc`:
|
44
|
+
|
45
|
+
```bash
|
46
|
+
. `gem which branch_io_cli | sed 's+branch_io_cli.rb$+assets/completions/completion.bash+'`
|
47
|
+
```
|
48
|
+
|
49
|
+
#### Zsh
|
50
|
+
|
51
|
+
Add to `~/.zshrc`:
|
52
|
+
|
53
|
+
```zsh
|
54
|
+
. `gem which branch_io_cli | sed 's+branch_io_cli.rb$+assets/completions/completion.zsh+'`
|
55
|
+
```
|
56
|
+
|
57
|
+
Currently command-line completion for bash is much more extensive than for zsh.
|
58
|
+
|
33
59
|
## Commands
|
34
60
|
|
35
61
|
### Setup command
|
@@ -86,6 +112,9 @@ command, respectively, available in your path.
|
|
86
112
|
|
87
113
|
|Option|Description|
|
88
114
|
|------|-----------|
|
115
|
+
|-h, --help|Prints a list of commands or help for each command|
|
116
|
+
|-v, --version|Prints the current version of the CLI|
|
117
|
+
|-t, --trace|Prints a stack trace when exceptions are raised|
|
89
118
|
|-L, --live-key key_live_xxxx|Branch live key|
|
90
119
|
|-T, --test-key key_test_yyyy|Branch test key|
|
91
120
|
|--app-link-subdomain myapp|Branch app.link subdomain, e.g. myapp for myapp.app.link|
|
@@ -154,6 +183,9 @@ targets.
|
|
154
183
|
|
155
184
|
|Option|Description|
|
156
185
|
|------|-----------|
|
186
|
+
|-h, --help|Prints a list of commands or help for each command|
|
187
|
+
|-v, --version|Prints the current version of the CLI|
|
188
|
+
|-t, --trace|Prints a stack trace when exceptions are raised|
|
157
189
|
|-D, --domains example.com,www.example.com|Comma-separated list of domains. May include app.link subdomains.|
|
158
190
|
|--xcodeproj MyProject.xcodeproj|Path to an Xcode project to update|
|
159
191
|
|--target MyAppTarget|Name of a target to modify in the Xcode project|
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
_branch_io_complete()
|
4
|
+
{
|
5
|
+
local cur prev opts global_opts setup_opts validate_opts commands cmd
|
6
|
+
COMPREPLY=()
|
7
|
+
cur="${COMP_WORDS[COMP_CWORD]}"
|
8
|
+
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
9
|
+
cmd="${COMP_WORDS[1]}"
|
10
|
+
|
11
|
+
commands="setup validate"
|
12
|
+
global_opts="-h --help -t --trace -v --version"
|
13
|
+
|
14
|
+
setup_opts="$global_opts -L --live-key -T --test-key -D --domains --app-link-subdomain -U --uri-scheme"
|
15
|
+
setup_opts="$setup_opts --xcodeproj --target --frameworks --podfile --cartfile"
|
16
|
+
# Don't autocomplete the default values here, e.g. --no-force, --pod-repo-update.
|
17
|
+
setup_opts="$setup_opts --no-add-sdk --no-validate --force --no-pod-repo-update --commit --no-patch-source"
|
18
|
+
|
19
|
+
validate_opts="$global_opts -D --domains --xcodeproj --target"
|
20
|
+
|
21
|
+
if [[ ${cur} == -* ]] ; then
|
22
|
+
case "${cmd}" in
|
23
|
+
setup)
|
24
|
+
opts=$setup_opts
|
25
|
+
;;
|
26
|
+
validate)
|
27
|
+
opts=$validate_opts
|
28
|
+
;;
|
29
|
+
*)
|
30
|
+
opts=$global_opts
|
31
|
+
;;
|
32
|
+
esac
|
33
|
+
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
34
|
+
elif [[ ${prev} == branch_io ]] ; then
|
35
|
+
COMPREPLY=( $(compgen -W "${commands}" -- ${cur}) )
|
36
|
+
else
|
37
|
+
COMPREPLY=( $(compgen -o default ${cur}) )
|
38
|
+
fi
|
39
|
+
return 0
|
40
|
+
}
|
41
|
+
complete -F _branch_io_complete branch_io
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/bin/zsh
|
2
|
+
|
3
|
+
_branch_io_complete() {
|
4
|
+
local word opts
|
5
|
+
word="$1"
|
6
|
+
opts="-h --help -t --trace -v --version"
|
7
|
+
opts="$opts -L --live-key -T --test-key -D --domains --app-link-subdomain -U --uri-scheme"
|
8
|
+
opts="$opts --xcodeproj --target --frameworks --podfile --cartfile"
|
9
|
+
# Don't autocomplete the default values here, e.g. --no-force, --pod-repo-update.
|
10
|
+
opts="$opts --no-add-sdk --no-validate --force --no-pod-repo-update --commit --no-patch-source"
|
11
|
+
|
12
|
+
reply=( "${(ps: :)opts}" )
|
13
|
+
}
|
14
|
+
|
15
|
+
compctl -K _branch_io_complete branch_io
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: branch_io_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Branch
|
@@ -220,6 +220,8 @@ files:
|
|
220
220
|
- LICENSE
|
221
221
|
- README.md
|
222
222
|
- bin/branch_io
|
223
|
+
- lib/assets/completions/completion.bash
|
224
|
+
- lib/assets/completions/completion.zsh
|
223
225
|
- lib/branch_io_cli.rb
|
224
226
|
- lib/branch_io_cli/cli.rb
|
225
227
|
- lib/branch_io_cli/commands.rb
|