forked from pkallberg/cx
/
help.go
59 lines (47 loc) · 1.62 KB
/
help.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package main
import (
"fmt"
"github.com/cloud66/cli"
)
var cmdHelpEnviron = &Command{
Name: "help-environ",
Build: buildBasicCommand,
Run: dummyCommand,
Short: "environment variables used by cx",
Long: `
Several environment variables affect cx's behavior.
CLOUD66_API_URL
The base URL hk will use to make api requests in the format:
https://host[:port]/
Its default value is https://app.cloud66.com/api/2
CXDEBUG
When this is set, cx prints the wire representation of each API
request to stderr just before sending the request, and prints the
response. This will most likely include your secret API key in
the Authorization header field, so be careful with the output.
CXENVIRONMENT
When this is set, cx looks for an environment specific OAuth token file.
Normally the authentication file is called cx.json as is located under ~/.cloud66
directory. Using this environment variable, cx will look for cx_<environment>.json
file instead.
CX_APP_ID, CX_APP_SECRET
Normally cx uses production environment app ID and secret. When this is set, the normal app ID
and secrects are overwritten. This is used for debugging and development purposes.
CXSTACK
If set, it overrides the stack sent as a parameter to the commands.
This can be the name of the stack or its UID.
CXTOKEN
Anything set to this will be passed as X-CxToken HTTP header to the server.
Used for development purposes.
`,
}
func dummyCommand(c *cli.Context) {
cli.ShowCommandHelp(c, "help-environ")
}
func runVersion(c *cli.Context) {
fmt.Println(VERSION)
if debugMode {
fmt.Println("Running in debug mode")
fmt.Printf("Build date: %s\n", BUILD_DATE)
}
}