File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,13 @@ var Version = "N/A"
1717// the time of build
1818var BuildTime = "N/A"
1919
20+ // AppName is the name of the binary. Defaults to "step" if not set.
21+ var AppName = ""
22+
2023func init () {
2124 step .Set ("Smallstep CLI" , Version , BuildTime )
2225 ca .UserAgent = step .Version ()
26+ cmd .SetName (AppName )
2327}
2428
2529func main () {
Original file line number Diff line number Diff line change @@ -80,6 +80,16 @@ func Run() int {
8080 return 0
8181}
8282
83+ var (
84+ stepAppName = "step"
85+ )
86+
87+ func SetName (appName string ) {
88+ if appName != "" {
89+ stepAppName = appName
90+ }
91+ }
92+
8393func newApp (stdout , stderr io.Writer ) * cli.App {
8494 // Define default file writers and prompters for go.step.sm/crypto
8595 pemutil .WriteFile = utils .WriteFile
@@ -103,8 +113,8 @@ func newApp(stdout, stderr io.Writer) *cli.App {
103113
104114 // Configure cli app
105115 app := cli .NewApp ()
106- app .Name = "step"
107- app .HelpName = "step"
116+ app .Name = stepAppName // "step" by default
117+ app .HelpName = stepAppName // "step" by default
108118 app .Usage = "plumbing for distributed systems"
109119 app .Version = step .Version ()
110120 app .Commands = command .Retrieve ()
You can’t perform that action at this time.
0 commit comments