MCPcopy Index your code
hub / github.com/smallstep/cli / GetPrefixedCommandUsage

Function GetPrefixedCommandUsage

command/ca/policy/policycontext/context.go:131–168  ·  view source on GitHub ↗
(ctx context.Context, commandName string)

Source from the content-addressed store, hash-verified

129}
130
131func GetPrefixedCommandUsage(ctx context.Context, commandName string) string {
132 usage := "step ca policy"
133
134 switch {
135 case IsAuthorityPolicyLevel(ctx):
136 usage += " authority"
137 case IsProvisionerPolicyLevel(ctx):
138 usage += " provisioner"
139 case IsACMEPolicyLevel(ctx):
140 usage += " acme"
141 default:
142 panic("no policy level set")
143 }
144
145 switch {
146 case IsX509Policy(ctx):
147 usage += " x509"
148 case IsSSHHostPolicy(ctx):
149 usage += " ssh host"
150 case IsSSHUserPolicy(ctx):
151 usage += " ssh user"
152 default:
153 // noop; not every command using policycontext needs this to be set
154 break
155 }
156
157 switch {
158 case IsAllow(ctx):
159 usage += " allow"
160 case IsDeny(ctx):
161 usage += " deny"
162 default:
163 // noop; not every command using policycontext needs this to be set
164 break
165 }
166
167 return usage + " " + commandName
168}

Callers 8

EmailCommandFunction · 0.92
RemoveCommandFunction · 0.92
DNSCommandFunction · 0.92
PrincipalsCommandFunction · 0.92
CommonNamesCommandFunction · 0.92
IPCommandFunction · 0.92
URICommandFunction · 0.92
ViewCommandFunction · 0.92

Calls 8

IsAuthorityPolicyLevelFunction · 0.85
IsProvisionerPolicyLevelFunction · 0.85
IsACMEPolicyLevelFunction · 0.85
IsX509PolicyFunction · 0.85
IsSSHHostPolicyFunction · 0.85
IsSSHUserPolicyFunction · 0.85
IsAllowFunction · 0.85
IsDenyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…