-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathconstants.go
More file actions
90 lines (80 loc) · 2.49 KB
/
constants.go
File metadata and controls
90 lines (80 loc) · 2.49 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package constants
const (
ExecutableName = "octopus"
)
// flags for command line switches
const (
FlagVersion = "version"
FlagHelp = "help"
FlagSpace = "space"
FlagOutputFormat = "output-format"
FlagOutputFormatLegacy = "outputFormat"
FlagNoPrompt = "no-prompt"
)
// flags for storing things in the go context
const (
ContextKeyTimeNow = "time.now" // func() time.Time
ContextKeyOsOpen = "os.open" // func(string) (io.ReadCloser, error)
)
// values for output formats
const (
OutputFormatJson = "json"
OutputFormatBasic = "basic"
OutputFormatTable = "table" // TODO I'd like to rename this to just "standard" or "default"; discuss with team
)
// keys for key/value store config file
const (
ConfigUrl = "Url"
ConfigApiKey = "ApiKey"
ConfigAccessToken = "AccessToken"
ConfigSpace = "Space"
ConfigNoPrompt = "NoPrompt"
// ConfigProxyUrl = "ProxyUrl"
ConfigEditor = "Editor"
ConfigShowOctopus = "ShowOctopus"
ConfigOutputFormat = "OutputFormat"
)
const (
EnvOctopusUrl = "OCTOPUS_URL"
EnvOctopusApiKey = "OCTOPUS_API_KEY"
EnvOctopusAccessToken = "OCTOPUS_ACCESS_TOKEN"
EnvOctopusSpace = "OCTOPUS_SPACE"
EnvEditor = "EDITOR"
EnvVisual = "VISUAL"
EnvCI = "CI"
)
const (
NoDescription = "No description provided"
)
const OctopusLogo = ` &#BGGGGGGB#&
&GP%%%%%%%%%%%%%G&
&G%%%%%%%%%%%%%%%%%%P&
&%%%%%%%%%%%%%%%%%%%%%%#
%%%%%%%%%%%%%%%%%%%%%%%%
#%%%%%%%%%%%%%%%%%%%%%%%%&
#%%%%%%%%%%%%%%%%%%%%%%%%&
P%%%%%%%%%%%%%%%%%%%%%%#
&%%%%%%%%%%%%%%%%%%%%%G
B%%%%%%%%%%%%%%%%%%%%#
P%%%%%%%%%%%%%%%%%%%%P
&P%%%%%%%%%%%%%%%%%%%%%%P#
#G%%%%P%%%%%%GP%%%%%%PP%%%%%PG&
&G%%%PB&#P%%%%G G%%%%P &P%%P#&&
&& G%%%%# &%%%%G #P%%#
&%%%G& G%%%B &&
&# BPB`
const (
PromptCreateNew = "<Create New>"
)
// IsProgrammaticOutputFormat tells you if it is acceptable for your command to
// print miscellaneous output to stdout, such as progress messages.
// If your command is capable of printing such things, you should check the output format
// first, lest you print a progress message into the middle of a JSON document by accident.
func IsProgrammaticOutputFormat(outputFormat string) bool { // TODO consider whether we should move this into the Factory
switch outputFormat {
case OutputFormatJson, OutputFormatBasic:
return true
default:
return false
}
}