Skip to content

Commit 61a2334

Browse files
committed
Changed pathSpec to pathGlob
1 parent 0f45029 commit 61a2334

File tree

9 files changed

+113
-340
lines changed

9 files changed

+113
-340
lines changed

cmd/clace/account_cmds.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,25 @@ func accountLinkCommand(commonFlags []cli.Flag, clientConfig *types.ClientConfig
3636
Usage: "Link an app to to use specific account for a plugin",
3737
Flags: flags,
3838
Before: altsrc.InitInputSourceWithContext(flags, altsrc.NewTomlSourceFromFlagFunc(configFileFlagName)),
39-
ArgsUsage: "<pathSpec> <pluginName> <accountName>",
40-
UsageText: `args: <pathSpec> <pluginName> <accountName>
39+
ArgsUsage: "<appPathGlob> <pluginName> <accountName>",
40+
UsageText: `args: <appPathGlob> <pluginName> <accountName>
4141
42-
<pathSpec> is the first required argument. ` + PATH_SPEC_HELP + `<pluginName> is the required second argument. This is the name of the plugin.
42+
<appPathGlob> is the first required argument. ` + PATH_SPEC_HELP + `<pluginName> is the required second argument. This is the name of the plugin.
4343
<accountName> is the required third argument. This is the name of the account to link to for the plugin. Use "-" to unlink the existing account.
4444
4545
Examples:
4646
Link db plugin: clace account link /myapp store.in temp
4747
Link in dryrun mode: clace account link --dry-run example.com:/ rest.in testaccount`,
4848
Action: func(cCtx *cli.Context) error {
4949
if cCtx.NArg() != 3 {
50-
return fmt.Errorf("requires three arguments: <pathSpec> <pluginName> <accountName>")
50+
return fmt.Errorf("requires three arguments: <pluginName> <accountName> <appPathGlob>")
5151
}
5252

5353
client := system.NewHttpClient(clientConfig.ServerUri, clientConfig.AdminUser, clientConfig.Client.AdminPassword, clientConfig.Client.SkipCertCheck)
5454
values := url.Values{}
55-
values.Add("pathSpec", cCtx.Args().First())
56-
values.Add("plugin", cCtx.Args().Get(1))
57-
values.Add("account", cCtx.Args().Get(2))
55+
values.Add("plugin", cCtx.Args().Get(0))
56+
values.Add("account", cCtx.Args().Get(1))
57+
values.Add("appPathGlob", cCtx.Args().Get(2))
5858
values.Add(DRY_RUN_ARG, strconv.FormatBool(cCtx.Bool(DRY_RUN_FLAG)))
5959
values.Add(PROMOTE_ARG, strconv.FormatBool(cCtx.Bool(PROMOTE_FLAG)))
6060

@@ -160,26 +160,26 @@ func updateParamsCommand(commonFlags []cli.Flag, clientConfig *types.ClientConfi
160160
Usage: "Update parameter value for the app",
161161
Flags: flags,
162162
Before: altsrc.InitInputSourceWithContext(flags, altsrc.NewTomlSourceFromFlagFunc(configFileFlagName)),
163-
ArgsUsage: "<paramName> <paramValue> <pathSpec>",
164-
UsageText: `args: <paramName> <paramValue> <pathSpec>
163+
ArgsUsage: "<paramName> <paramValue> <appPathGlob>",
164+
UsageText: `args: <paramName> <paramValue> <appPathGlob>
165165
166166
<paramName> is the first required argument. This is the parameter name.
167167
<paramValue> is the second required argument. This is the value to set the param to. Use "-" to unset the parameter.
168-
<pathSpec> is the third required argument. ` + PATH_SPEC_HELP + `
168+
<appPathGlob> is the third required argument. ` + PATH_SPEC_HELP + `
169169
170170
Examples:
171171
Update parameter value: clace param update port 8888 /myapp
172172
Delete parameter value: clace param update port - /myapp`,
173173
Action: func(cCtx *cli.Context) error {
174174
if cCtx.NArg() != 3 {
175-
return fmt.Errorf("requires three arguments: <paramName> <paramValue> <pathSpec>")
175+
return fmt.Errorf("requires three arguments: <paramName> <paramValue> <appPathGlob>")
176176
}
177177

178178
client := system.NewHttpClient(clientConfig.ServerUri, clientConfig.AdminUser, clientConfig.Client.AdminPassword, clientConfig.Client.SkipCertCheck)
179179
values := url.Values{}
180180
values.Add("paramName", cCtx.Args().Get(0))
181181
values.Add("paramValue", cCtx.Args().Get(1))
182-
values.Add("pathSpec", cCtx.Args().Get(2))
182+
values.Add("appPathGlob", cCtx.Args().Get(2))
183183
values.Add(DRY_RUN_ARG, strconv.FormatBool(cCtx.Bool(DRY_RUN_FLAG)))
184184
values.Add(PROMOTE_ARG, strconv.FormatBool(cCtx.Bool(PROMOTE_FLAG)))
185185

cmd/clace/app_cmds.go

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const (
2121
DRY_RUN_FLAG = "dry-run"
2222
DRY_RUN_ARG = "dryRun"
2323
DRY_RUN_MESSAGE = "\n*** dry-run mode, changes have NOT been committed. ***\n"
24-
PATH_SPEC_HELP = `The domain and path are separated by a ":". pathSpec supports a glob pattern.
24+
PATH_SPEC_HELP = `The (optional) domain and path are separated by a ":". appPathGlob supports a glob pattern.
2525
In the glob, * matches any number of characters, ** matches any number of characters including /.
2626
all is a shortcut for "*:**", which matches all apps across all domains, including no domain.
2727
To prevent shell expansion for *, placing the path in quotes is recommended.
@@ -174,10 +174,10 @@ func appListCommand(commonFlags []cli.Flag, clientConfig *types.ClientConfig) *c
174174
Usage: "List apps",
175175
Flags: flags,
176176
Before: altsrc.InitInputSourceWithContext(flags, altsrc.NewTomlSourceFromFlagFunc(configFileFlagName)),
177-
ArgsUsage: "[<pathSpec>]",
178-
UsageText: `args: [<pathSpec>]
177+
ArgsUsage: "[<appPathGlob>]",
178+
UsageText: `args: [<appPathGlob>]
179179
180-
<pathSpec> defaults to "*:**" (same as "all") for the list command.
180+
<appPathGlob> defaults to "*:**" (same as "all") for the list command.
181181
` + PATH_SPEC_HELP +
182182
`
183183
Examples:
@@ -190,12 +190,12 @@ Examples:
190190
List apps at the lop level with no domain specified, with jsonl format: clace app list --format jsonl "*"`,
191191
Action: func(cCtx *cli.Context) error {
192192
if cCtx.NArg() > 1 {
193-
return fmt.Errorf("only one argument expected: <pathSpec>")
193+
return fmt.Errorf("only one argument expected: <appPathGlob>")
194194
}
195195
values := url.Values{}
196196
values.Add("internal", fmt.Sprintf("%t", cCtx.Bool("internal")))
197197
if cCtx.NArg() == 1 {
198-
values.Add("pathSpec", cCtx.Args().Get(0))
198+
values.Add("appPathGlob", cCtx.Args().Get(0))
199199
}
200200

201201
client := system.NewHttpClient(clientConfig.ServerUri, clientConfig.AdminUser, clientConfig.Client.AdminPassword, clientConfig.Client.SkipCertCheck)
@@ -327,24 +327,24 @@ func appDeleteCommand(commonFlags []cli.Flag, clientConfig *types.ClientConfig)
327327
Usage: "Delete an app",
328328
Flags: flags,
329329
Before: altsrc.InitInputSourceWithContext(flags, altsrc.NewTomlSourceFromFlagFunc(configFileFlagName)),
330-
ArgsUsage: "<pathSpec>",
330+
ArgsUsage: "<appPathGlob>",
331331

332-
UsageText: `args: <pathSpec>
332+
UsageText: `args: <appPathGlob>
333333
334-
<pathSpec> is a required argument. ` + PATH_SPEC_HELP + `
334+
<appPathGlob> is a required argument. ` + PATH_SPEC_HELP + `
335335
336336
Examples:
337337
Delete all apps, across domains, in dry-run mode: clace app delete --dry-run all
338338
Delete apps in the example.com domain: clace app delete "example.com:**"`,
339339

340340
Action: func(cCtx *cli.Context) error {
341341
if cCtx.NArg() != 1 {
342-
return fmt.Errorf("requires one argument: <pathSpec>")
342+
return fmt.Errorf("requires one argument: <appPathGlob>")
343343
}
344344

345345
client := system.NewHttpClient(clientConfig.ServerUri, clientConfig.AdminUser, clientConfig.Client.AdminPassword, clientConfig.Client.SkipCertCheck)
346346
values := url.Values{}
347-
values.Add("pathSpec", cCtx.Args().Get(0))
347+
values.Add("appPathGlob", cCtx.Args().Get(0))
348348
values.Add(DRY_RUN_ARG, strconv.FormatBool(cCtx.Bool(DRY_RUN_FLAG)))
349349

350350
var deleteResult types.AppDeleteResponse
@@ -377,11 +377,11 @@ func appApproveCommand(commonFlags []cli.Flag, clientConfig *types.ClientConfig)
377377
Usage: "Approve app permissions",
378378
Flags: flags,
379379
Before: altsrc.InitInputSourceWithContext(flags, altsrc.NewTomlSourceFromFlagFunc(configFileFlagName)),
380-
ArgsUsage: "<pathSpec>",
380+
ArgsUsage: "<appPathGlob>",
381381

382-
UsageText: `args: <pathSpec>
382+
UsageText: `args: <appPathGlob>
383383
384-
<pathSpec> is a required argument. ` + PATH_SPEC_HELP + `
384+
<appPathGlob> is a required argument. ` + PATH_SPEC_HELP + `
385385
386386
Examples:
387387
Approve all apps, across domains: clace app approve all
@@ -390,12 +390,12 @@ func appApproveCommand(commonFlags []cli.Flag, clientConfig *types.ClientConfig)
390390

391391
Action: func(cCtx *cli.Context) error {
392392
if cCtx.NArg() != 1 {
393-
return fmt.Errorf("requires one argument: <pathSpec>")
393+
return fmt.Errorf("requires one argument: <appPathGlob>")
394394
}
395395

396396
client := system.NewHttpClient(clientConfig.ServerUri, clientConfig.AdminUser, clientConfig.Client.AdminPassword, clientConfig.Client.SkipCertCheck)
397397
values := url.Values{}
398-
values.Add("pathSpec", cCtx.Args().Get(0))
398+
values.Add("appPathGlob", cCtx.Args().Get(0))
399399
values.Add(DRY_RUN_ARG, strconv.FormatBool(cCtx.Bool(DRY_RUN_FLAG)))
400400
values.Add(PROMOTE_ARG, strconv.FormatBool(cCtx.Bool(PROMOTE_FLAG)))
401401

@@ -454,11 +454,11 @@ func appReloadCommand(commonFlags []cli.Flag, clientConfig *types.ClientConfig)
454454
Usage: "Reload the app source code",
455455
Flags: flags,
456456
Before: altsrc.InitInputSourceWithContext(flags, altsrc.NewTomlSourceFromFlagFunc(configFileFlagName)),
457-
ArgsUsage: "<pathSpec>",
457+
ArgsUsage: "<appPathGlob>",
458458

459-
UsageText: `args: <pathSpec>
459+
UsageText: `args: <appPathGlob>
460460
461-
<pathSpec> is a required argument. ` + PATH_SPEC_HELP + `
461+
<appPathGlob> is a required argument. ` + PATH_SPEC_HELP + `
462462
Dev apps are reloaded from disk. For prod apps, the stage app is reloaded from git (or from local disk if git is not used).
463463
If --approve option is specified, the app permissions are audited and approved. If --approve is not specified and the app needs additional
464464
permissions, the reload will fail. If --promote is specified, the stage app is promoted to prod after reload. If --promote is not specified,
@@ -474,12 +474,12 @@ func appReloadCommand(commonFlags []cli.Flag, clientConfig *types.ClientConfig)
474474

475475
Action: func(cCtx *cli.Context) error {
476476
if cCtx.NArg() != 1 {
477-
return fmt.Errorf("requires one argument: <pathSpec>")
477+
return fmt.Errorf("requires one argument: <appPathGlob>")
478478
}
479479

480480
client := system.NewHttpClient(clientConfig.ServerUri, clientConfig.AdminUser, clientConfig.Client.AdminPassword, clientConfig.Client.SkipCertCheck)
481481
values := url.Values{}
482-
values.Add("pathSpec", cCtx.Args().First())
482+
values.Add("appPathGlob", cCtx.Args().First())
483483
values.Add("approve", strconv.FormatBool(cCtx.Bool("approve")))
484484
values.Add("promote", strconv.FormatBool(cCtx.Bool("promote")))
485485
values.Add("branch", cCtx.String("branch"))
@@ -550,23 +550,23 @@ func appPromoteCommand(commonFlags []cli.Flag, clientConfig *types.ClientConfig)
550550
Usage: "Promote the app from staging to production",
551551
Flags: flags,
552552
Before: altsrc.InitInputSourceWithContext(flags, altsrc.NewTomlSourceFromFlagFunc(configFileFlagName)),
553-
ArgsUsage: "<pathSpec>",
554-
UsageText: `args: <pathSpec>
553+
ArgsUsage: "<appPathGlob>",
554+
UsageText: `args: <appPathGlob>
555555
556-
<pathSpec> is a required argument. ` + PATH_SPEC_HELP + `
556+
<appPathGlob> is a required argument. ` + PATH_SPEC_HELP + `
557557
558558
Examples:
559559
Promote all apps, across domains: clace app promote all
560560
Promote apps in the example.com domain: clace app promote "example.com:**"`,
561561

562562
Action: func(cCtx *cli.Context) error {
563563
if cCtx.NArg() != 1 {
564-
return fmt.Errorf("requires one argument: <pathSpec>")
564+
return fmt.Errorf("requires one argument: <appPathGlob>")
565565
}
566566

567567
client := system.NewHttpClient(clientConfig.ServerUri, clientConfig.AdminUser, clientConfig.Client.AdminPassword, clientConfig.Client.SkipCertCheck)
568568
values := url.Values{}
569-
values.Add("pathSpec", cCtx.Args().First())
569+
values.Add("appPathGlob", cCtx.Args().First())
570570
values.Add(DRY_RUN_ARG, strconv.FormatBool(cCtx.Bool(DRY_RUN_FLAG)))
571571

572572
var promoteResponse types.AppPromoteResponse

cmd/clace/app_updates.go

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,25 @@ func appUpdateStageWrite(commonFlags []cli.Flag, clientConfig *types.ClientConfi
3737
Usage: "Update write access permission for staging app",
3838
Flags: flags,
3939
Before: altsrc.InitInputSourceWithContext(flags, altsrc.NewTomlSourceFromFlagFunc(configFileFlagName)),
40-
ArgsUsage: "<value:true|false> <pathSpec>",
40+
ArgsUsage: "<value:true|false> <appPathGlob>",
4141

42-
UsageText: `args: <value:true|false> <pathSpec>
42+
UsageText: `args: <value:true|false> <appPathGlob>
4343
4444
The first required argument <value> is a boolean value, true or false.
45-
The second required argument is <pathSpec>. ` + PATH_SPEC_HELP + `
45+
The second required argument is <appPathGlob>. ` + PATH_SPEC_HELP + `
4646
4747
Examples:
4848
Update all apps, across domains: clace app update-settings stage-write-access true all
4949
Update apps in the example.com domain: clace app update-settings stage-write-access false "example.com:**"`,
5050

5151
Action: func(cCtx *cli.Context) error {
5252
if cCtx.NArg() != 2 {
53-
return fmt.Errorf("requires two argument: <value> <pathSpec>")
53+
return fmt.Errorf("requires two arguments: <value> <appPathGlob>")
5454
}
5555

5656
client := system.NewHttpClient(clientConfig.ServerUri, clientConfig.AdminUser, clientConfig.Client.AdminPassword, clientConfig.Client.SkipCertCheck)
5757
values := url.Values{}
58-
values.Add("pathSpec", cCtx.Args().Get(1))
58+
values.Add("appPathGlob", cCtx.Args().Get(1))
5959
values.Add(DRY_RUN_ARG, strconv.FormatBool(cCtx.Bool(DRY_RUN_FLAG)))
6060

6161
body := types.CreateUpdateAppRequest()
@@ -99,25 +99,25 @@ func appUpdatePreviewWrite(commonFlags []cli.Flag, clientConfig *types.ClientCon
9999
Usage: "Update write access permission for preview apps",
100100
Flags: flags,
101101
Before: altsrc.InitInputSourceWithContext(flags, altsrc.NewTomlSourceFromFlagFunc(configFileFlagName)),
102-
ArgsUsage: "<value:true|false> <pathSpec>",
102+
ArgsUsage: "<value:true|false> <appPathGlob>",
103103

104-
UsageText: `args: <value:true|false> <pathSpec>
104+
UsageText: `args: <value:true|false> <appPathGlob>
105105
106106
The first required argument <value> is a boolean value, true or false.
107-
The second required argument is <pathSpec>. ` + PATH_SPEC_HELP + `
107+
The second required argument is <appPathGlob>. ` + PATH_SPEC_HELP + `
108108
109109
Examples:
110110
Update all apps, across domains: clace app update-settings preview-write-access true all
111111
Update apps in the example.com domain: clace app update-settings preview-write-access false "example.com:**"`,
112112

113113
Action: func(cCtx *cli.Context) error {
114114
if cCtx.NArg() != 2 {
115-
return fmt.Errorf("requires two argument: <value> <pathSpec>")
115+
return fmt.Errorf("requires two arguments: <value> <appPathGlob>")
116116
}
117117

118118
client := system.NewHttpClient(clientConfig.ServerUri, clientConfig.AdminUser, clientConfig.Client.AdminPassword, clientConfig.Client.SkipCertCheck)
119119
values := url.Values{}
120-
values.Add("pathSpec", cCtx.Args().Get(1))
120+
values.Add("appPathGlob", cCtx.Args().Get(1))
121121
values.Add(DRY_RUN_ARG, strconv.FormatBool(cCtx.Bool(DRY_RUN_FLAG)))
122122

123123
body := types.CreateUpdateAppRequest()
@@ -161,25 +161,25 @@ func appUpdateAuthnType(commonFlags []cli.Flag, clientConfig *types.ClientConfig
161161
Usage: "Update authentication mode for apps",
162162
Flags: flags,
163163
Before: altsrc.InitInputSourceWithContext(flags, altsrc.NewTomlSourceFromFlagFunc(configFileFlagName)),
164-
ArgsUsage: "<value:system|default|none|custom> <pathSpec>",
164+
ArgsUsage: "<value:system|default|none|custom> <appPathGlob>",
165165

166-
UsageText: `args: <value:default|none> <pathSpec>
166+
UsageText: `args: <value:default|none> <appPathGlob>
167167
168168
The first required argument <value> is a string, system, default, none or OAuth entry name.
169-
The second required argument is <pathSpec>. ` + PATH_SPEC_HELP + `
169+
The second required argument is <appPathGlob>. ` + PATH_SPEC_HELP + `
170170
171171
Examples:
172172
Update all apps, across domains: clace app update-settings auth default all
173173
Update apps in the example.com domain: clace app update-settings auth none "example.com:**"`,
174174

175175
Action: func(cCtx *cli.Context) error {
176176
if cCtx.NArg() != 2 {
177-
return fmt.Errorf("requires two argument: <value> <pathSpec>")
177+
return fmt.Errorf("requires two arguments: <value> <appPathGlob>")
178178
}
179179

180180
client := system.NewHttpClient(clientConfig.ServerUri, clientConfig.AdminUser, clientConfig.Client.AdminPassword, clientConfig.Client.SkipCertCheck)
181181
values := url.Values{}
182-
values.Add("pathSpec", cCtx.Args().Get(1))
182+
values.Add("appPathGlob", cCtx.Args().Get(1))
183183
values.Add(DRY_RUN_ARG, strconv.FormatBool(cCtx.Bool(DRY_RUN_FLAG)))
184184

185185
body := types.CreateUpdateAppRequest()
@@ -214,26 +214,26 @@ func appUpdateGitAuth(commonFlags []cli.Flag, clientConfig *types.ClientConfig)
214214
Usage: "Update git-auth entry for apps",
215215
Flags: flags,
216216
Before: altsrc.InitInputSourceWithContext(flags, altsrc.NewTomlSourceFromFlagFunc(configFileFlagName)),
217-
ArgsUsage: "<entryName> <pathSpec>",
217+
ArgsUsage: "<entryName> <appPathGlob>",
218218

219-
UsageText: `args: <entryName> <pathSpec>
219+
UsageText: `args: <entryName> <appPathGlob>
220220
221221
The first required argument <entryName> is a string. Specify the git_auth entry key name as configured in the clace.toml config.
222222
Set to "-" to remove the git_auth entry.
223-
The second required argument is <pathSpec>. ` + PATH_SPEC_HELP + `
223+
The second required argument is <appPathGlob>. ` + PATH_SPEC_HELP + `
224224
225225
Examples:
226226
Update all apps, across domains: clace app update-settings git-auth mygit all
227227
Update apps in the example.com domain: clace app git-auth gitentrykey "example.com:**"`,
228228

229229
Action: func(cCtx *cli.Context) error {
230230
if cCtx.NArg() != 2 {
231-
return fmt.Errorf("requires two argument: <entryName> <pathSpec>")
231+
return fmt.Errorf("requires two arguments: <entryName> <appPathGlob>")
232232
}
233233

234234
client := system.NewHttpClient(clientConfig.ServerUri, clientConfig.AdminUser, clientConfig.Client.AdminPassword, clientConfig.Client.SkipCertCheck)
235235
values := url.Values{}
236-
values.Add("pathSpec", cCtx.Args().Get(1))
236+
values.Add("appPathGlob", cCtx.Args().Get(1))
237237
values.Add(DRY_RUN_ARG, strconv.FormatBool(cCtx.Bool(DRY_RUN_FLAG)))
238238

239239
body := types.CreateUpdateAppRequest()
@@ -279,25 +279,25 @@ func appUpdateAppSpec(commonFlags []cli.Flag, clientConfig *types.ClientConfig)
279279
Usage: "Update app spec for apps",
280280
Flags: flags,
281281
Before: altsrc.InitInputSourceWithContext(flags, altsrc.NewTomlSourceFromFlagFunc(configFileFlagName)),
282-
ArgsUsage: "<value:spec_name|none> <pathSpec>",
282+
ArgsUsage: "<value:spec_name|none> <appPathGlob>",
283283

284-
UsageText: `args: <value:spec_name|none> <pathSpec>
284+
UsageText: `args: <value:spec_name|none> <appPathGlob>
285285
286286
The first required argument <value> is a string, a valid app spec name or - (to unset spec).
287-
The second required argument is <pathSpec>. ` + PATH_SPEC_HELP + `
287+
The second required argument is <appPathGlob>. ` + PATH_SPEC_HELP + `
288288
289289
Examples:
290290
Update all apps, across domains: clace app update-metadata spec - all
291291
Update apps in the example.com domain: clace app update-metadata spec proxy "example.com:**"`,
292292

293293
Action: func(cCtx *cli.Context) error {
294294
if cCtx.NArg() != 2 {
295-
return fmt.Errorf("requires two argument: <value> <pathSpec>")
295+
return fmt.Errorf("requires two arguments: <value> <appPathGlob>")
296296
}
297297

298298
client := system.NewHttpClient(clientConfig.ServerUri, clientConfig.AdminUser, clientConfig.Client.AdminPassword, clientConfig.Client.SkipCertCheck)
299299
values := url.Values{}
300-
values.Add("pathSpec", cCtx.Args().Get(1))
300+
values.Add("appPathGlob", cCtx.Args().Get(1))
301301
values.Add(DRY_RUN_ARG, strconv.FormatBool(cCtx.Bool(DRY_RUN_FLAG)))
302302
values.Add(PROMOTE_ARG, strconv.FormatBool(cCtx.Bool(PROMOTE_FLAG)))
303303

0 commit comments

Comments
 (0)