Commit 7cd85b0
committed
plugin: Friendly error when run without arguments
Return a friendly error message when running a cf-cli plugin binary without
any arguments. I noticed this while repeatedly testing whether a dynamically
linked plugin would work on Alpine Linux. It is also noted as an issue for a
plugin that we use: bluemixgaragelondon/cf-blue-green-deploy#24
Before:
➜ cf-blue-green-deploy git:(master) ✗ ./cf-blue-green-deploy
panic: runtime error: index out of range
goroutine 1 [running]:
code.cloudfoundry.org/cli/plugin.Start(0x1594860, 0xc42011b560)
/Users/dcarley/projects/gocode/src/code.cloudfoundry.org/cli/plugin/plugin_shim.go:16 +0x3bd
main.main()
/Users/dcarley/projects/gocode/src/github.com/bluemixgaragelondon/cf-blue-green-deploy/main.go:198 +0xe9
After:
➜ cf-blue-green-deploy git:(master) ✗ ./cf-blue-green-deploy
This cf CLI plugin is not intended to be run on its own1 parent 1c591b0 commit 7cd85b0
2 files changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
| |||
0 commit comments