Skip to content

Commit 5b4aa73

Browse files
authored
Add categories to JFrog Artifactory commands (#2544)
1 parent 01930cf commit 5b4aa73

File tree

5 files changed

+74
-36
lines changed

5 files changed

+74
-36
lines changed

artifactory/cli.go

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,17 @@ import (
121121
"github.com/urfave/cli"
122122
)
123123

124+
const (
125+
filesCategory = "Files Management"
126+
buildCategory = "Build Info"
127+
repoCategory = "Repository Management"
128+
replicCategory = "Replication"
129+
permCategory = "Permission Targets"
130+
userCategory = "User Management"
131+
transferCategory = "Transfer Between Artifactory Instances"
132+
otherCategory = "Other"
133+
)
134+
124135
func GetCommands() []cli.Command {
125136
return cliutils.GetSortedCommands(cli.CommandsByName{
126137
{
@@ -133,6 +144,7 @@ func GetCommands() []cli.Command {
133144
ArgsUsage: common.CreateEnvVars(upload.EnvVar...),
134145
BashComplete: corecommon.CreateBashCompletionFunc(),
135146
Action: uploadCmd,
147+
Category: filesCategory,
136148
},
137149
{
138150
Name: "download",
@@ -144,6 +156,7 @@ func GetCommands() []cli.Command {
144156
ArgsUsage: common.CreateEnvVars(download.EnvVar...),
145157
BashComplete: corecommon.CreateBashCompletionFunc(),
146158
Action: downloadCmd,
159+
Category: filesCategory,
147160
},
148161
{
149162
Name: "move",
@@ -155,6 +168,7 @@ func GetCommands() []cli.Command {
155168
ArgsUsage: common.CreateEnvVars(move.EnvVar),
156169
BashComplete: corecommon.CreateBashCompletionFunc(),
157170
Action: moveCmd,
171+
Category: filesCategory,
158172
},
159173
{
160174
Name: "copy",
@@ -166,6 +180,7 @@ func GetCommands() []cli.Command {
166180
ArgsUsage: common.CreateEnvVars(copydocs.EnvVar),
167181
BashComplete: corecommon.CreateBashCompletionFunc(),
168182
Action: copyCmd,
183+
Category: filesCategory,
169184
},
170185
{
171186
Name: "delete",
@@ -177,6 +192,7 @@ func GetCommands() []cli.Command {
177192
ArgsUsage: common.CreateEnvVars(delete.EnvVar),
178193
BashComplete: corecommon.CreateBashCompletionFunc(),
179194
Action: deleteCmd,
195+
Category: filesCategory,
180196
},
181197
{
182198
Name: "search",
@@ -188,6 +204,7 @@ func GetCommands() []cli.Command {
188204
ArgsUsage: common.CreateEnvVars(search.EnvVar),
189205
BashComplete: corecommon.CreateBashCompletionFunc(),
190206
Action: searchCmd,
207+
Category: filesCategory,
191208
},
192209
{
193210
Name: "set-props",
@@ -199,6 +216,7 @@ func GetCommands() []cli.Command {
199216
ArgsUsage: common.CreateEnvVars(setprops.EnvVar),
200217
BashComplete: corecommon.CreateBashCompletionFunc(),
201218
Action: setPropsCmd,
219+
Category: filesCategory,
202220
},
203221
{
204222
Name: "delete-props",
@@ -210,6 +228,7 @@ func GetCommands() []cli.Command {
210228
ArgsUsage: common.CreateEnvVars(deleteprops.EnvVar),
211229
BashComplete: corecommon.CreateBashCompletionFunc(),
212230
Action: deletePropsCmd,
231+
Category: filesCategory,
213232
},
214233
{
215234
Name: "build-publish",
@@ -221,6 +240,7 @@ func GetCommands() []cli.Command {
221240
ArgsUsage: common.CreateEnvVars(),
222241
BashComplete: corecommon.CreateBashCompletionFunc(),
223242
Action: buildPublishCmd,
243+
Category: buildCategory,
224244
},
225245
{
226246
Name: "build-collect-env",
@@ -232,6 +252,7 @@ func GetCommands() []cli.Command {
232252
ArgsUsage: common.CreateEnvVars(),
233253
BashComplete: corecommon.CreateBashCompletionFunc(),
234254
Action: buildCollectEnvCmd,
255+
Category: buildCategory,
235256
},
236257
{
237258
Name: "build-append",
@@ -243,6 +264,7 @@ func GetCommands() []cli.Command {
243264
ArgsUsage: common.CreateEnvVars(),
244265
BashComplete: corecommon.CreateBashCompletionFunc(),
245266
Action: buildAppendCmd,
267+
Category: buildCategory,
246268
},
247269
{
248270
Name: "build-add-dependencies",
@@ -254,6 +276,7 @@ func GetCommands() []cli.Command {
254276
ArgsUsage: common.CreateEnvVars(),
255277
BashComplete: corecommon.CreateBashCompletionFunc(),
256278
Action: buildAddDependenciesCmd,
279+
Category: buildCategory,
257280
},
258281
{
259282
Name: "build-add-git",
@@ -265,6 +288,7 @@ func GetCommands() []cli.Command {
265288
ArgsUsage: common.CreateEnvVars(),
266289
BashComplete: corecommon.CreateBashCompletionFunc(),
267290
Action: buildAddGitCmd,
291+
Category: buildCategory,
268292
},
269293
{
270294
Name: "build-scan",
@@ -289,6 +313,7 @@ func GetCommands() []cli.Command {
289313
ArgsUsage: common.CreateEnvVars(),
290314
BashComplete: corecommon.CreateBashCompletionFunc(),
291315
Action: buildCleanCmd,
316+
Category: buildCategory,
292317
},
293318
{
294319
Name: "build-promote",
@@ -300,6 +325,7 @@ func GetCommands() []cli.Command {
300325
ArgsUsage: common.CreateEnvVars(),
301326
BashComplete: corecommon.CreateBashCompletionFunc(),
302327
Action: buildPromoteCmd,
328+
Category: buildCategory,
303329
},
304330
{
305331
Name: "build-discard",
@@ -311,6 +337,7 @@ func GetCommands() []cli.Command {
311337
ArgsUsage: common.CreateEnvVars(),
312338
BashComplete: corecommon.CreateBashCompletionFunc(),
313339
Action: buildDiscardCmd,
340+
Category: buildCategory,
314341
},
315342
{
316343
Name: "git-lfs-clean",
@@ -322,6 +349,7 @@ func GetCommands() []cli.Command {
322349
ArgsUsage: common.CreateEnvVars(),
323350
BashComplete: corecommon.CreateBashCompletionFunc(),
324351
Action: gitLfsCleanCmd,
352+
Category: otherCategory,
325353
},
326354
{
327355
Name: "mvn-config",
@@ -387,6 +415,7 @@ func GetCommands() []cli.Command {
387415
ArgsUsage: common.CreateEnvVars(),
388416
BashComplete: corecommon.CreateBashCompletionFunc(),
389417
Action: dockerPromoteCmd,
418+
Category: buildCategory,
390419
},
391420
{
392421
Name: "docker-push",
@@ -428,6 +457,7 @@ func GetCommands() []cli.Command {
428457
Action: func(c *cli.Context) error {
429458
return containerPushCmd(c, containerutils.Podman)
430459
},
460+
Category: otherCategory,
431461
},
432462
{
433463
Name: "podman-pull",
@@ -441,6 +471,7 @@ func GetCommands() []cli.Command {
441471
Action: func(c *cli.Context) error {
442472
return containerPullCmd(c, containerutils.Podman)
443473
},
474+
Category: otherCategory,
444475
},
445476
{
446477
Name: "build-docker-create",
@@ -452,6 +483,7 @@ func GetCommands() []cli.Command {
452483
ArgsUsage: common.CreateEnvVars(),
453484
BashComplete: corecommon.CreateBashCompletionFunc(),
454485
Action: BuildDockerCreateCmd,
486+
Category: buildCategory,
455487
},
456488
{
457489
Name: "oc", // Only 'oc start-build' is supported
@@ -463,6 +495,7 @@ func GetCommands() []cli.Command {
463495
SkipFlagParsing: true,
464496
BashComplete: corecommon.CreateBashCompletionFunc(),
465497
Action: ocStartBuildCmd,
498+
Category: otherCategory,
466499
},
467500
{
468501
Name: "npm-config",
@@ -582,6 +615,7 @@ func GetCommands() []cli.Command {
582615
ArgsUsage: common.CreateEnvVars(),
583616
BashComplete: corecommon.CreateBashCompletionFunc(),
584617
Action: nugetDepsTreeCmd,
618+
Category: otherCategory,
585619
},
586620
{
587621
Name: "dotnet-config",
@@ -709,6 +743,7 @@ func GetCommands() []cli.Command {
709743
ArgsUsage: common.CreateEnvVars(),
710744
BashComplete: corecommon.CreateBashCompletionFunc(),
711745
Action: repoTemplateCmd,
746+
Category: repoCategory,
712747
},
713748
{
714749
Name: "repo-create",
@@ -720,6 +755,7 @@ func GetCommands() []cli.Command {
720755
ArgsUsage: common.CreateEnvVars(),
721756
BashComplete: corecommon.CreateBashCompletionFunc(),
722757
Action: repoCreateCmd,
758+
Category: repoCategory,
723759
},
724760
{
725761
Name: "repo-update",
@@ -731,6 +767,7 @@ func GetCommands() []cli.Command {
731767
ArgsUsage: common.CreateEnvVars(),
732768
BashComplete: corecommon.CreateBashCompletionFunc(),
733769
Action: repoUpdateCmd,
770+
Category: repoCategory,
734771
},
735772
{
736773
Name: "repo-delete",
@@ -742,6 +779,7 @@ func GetCommands() []cli.Command {
742779
ArgsUsage: common.CreateEnvVars(),
743780
BashComplete: corecommon.CreateBashCompletionFunc(),
744781
Action: repoDeleteCmd,
782+
Category: repoCategory,
745783
},
746784
{
747785
Name: "replication-template",
@@ -753,6 +791,7 @@ func GetCommands() []cli.Command {
753791
ArgsUsage: common.CreateEnvVars(),
754792
BashComplete: corecommon.CreateBashCompletionFunc(),
755793
Action: replicationTemplateCmd,
794+
Category: replicCategory,
756795
},
757796
{
758797
Name: "replication-create",
@@ -764,6 +803,7 @@ func GetCommands() []cli.Command {
764803
ArgsUsage: common.CreateEnvVars(),
765804
BashComplete: corecommon.CreateBashCompletionFunc(),
766805
Action: replicationCreateCmd,
806+
Category: replicCategory,
767807
},
768808
{
769809
Name: "replication-delete",
@@ -775,6 +815,7 @@ func GetCommands() []cli.Command {
775815
ArgsUsage: common.CreateEnvVars(),
776816
BashComplete: corecommon.CreateBashCompletionFunc(),
777817
Action: replicationDeleteCmd,
818+
Category: replicCategory,
778819
},
779820
{
780821
Name: "permission-target-template",
@@ -785,6 +826,7 @@ func GetCommands() []cli.Command {
785826
ArgsUsage: common.CreateEnvVars(),
786827
BashComplete: corecommon.CreateBashCompletionFunc(),
787828
Action: permissionTargetTemplateCmd,
829+
Category: permCategory,
788830
},
789831
{
790832
Name: "permission-target-create",
@@ -796,6 +838,7 @@ func GetCommands() []cli.Command {
796838
ArgsUsage: common.CreateEnvVars(),
797839
BashComplete: corecommon.CreateBashCompletionFunc(),
798840
Action: permissionTargetCreateCmd,
841+
Category: permCategory,
799842
},
800843
{
801844
Name: "permission-target-update",
@@ -807,6 +850,7 @@ func GetCommands() []cli.Command {
807850
ArgsUsage: common.CreateEnvVars(),
808851
BashComplete: corecommon.CreateBashCompletionFunc(),
809852
Action: permissionTargetUpdateCmd,
853+
Category: permCategory,
810854
},
811855
{
812856
Name: "permission-target-delete",
@@ -818,6 +862,7 @@ func GetCommands() []cli.Command {
818862
ArgsUsage: common.CreateEnvVars(),
819863
BashComplete: corecommon.CreateBashCompletionFunc(),
820864
Action: permissionTargetDeleteCmd,
865+
Category: permCategory,
821866
},
822867
{
823868
Name: "user-create",
@@ -827,6 +872,7 @@ func GetCommands() []cli.Command {
827872
ArgsUsage: common.CreateEnvVars(),
828873
BashComplete: corecommon.CreateBashCompletionFunc(),
829874
Action: userCreateCmd,
875+
Category: userCategory,
830876
},
831877
{
832878
Name: "users-create",
@@ -837,6 +883,7 @@ func GetCommands() []cli.Command {
837883
ArgsUsage: common.CreateEnvVars(),
838884
BashComplete: corecommon.CreateBashCompletionFunc(),
839885
Action: usersCreateCmd,
886+
Category: userCategory,
840887
},
841888
{
842889
Name: "users-delete",
@@ -848,6 +895,7 @@ func GetCommands() []cli.Command {
848895
ArgsUsage: common.CreateEnvVars(),
849896
BashComplete: corecommon.CreateBashCompletionFunc(),
850897
Action: usersDeleteCmd,
898+
Category: userCategory,
851899
},
852900
{
853901
Name: "group-create",
@@ -859,6 +907,7 @@ func GetCommands() []cli.Command {
859907
ArgsUsage: common.CreateEnvVars(),
860908
BashComplete: corecommon.CreateBashCompletionFunc(),
861909
Action: groupCreateCmd,
910+
Category: userCategory,
862911
},
863912
{
864913
Name: "group-add-users",
@@ -870,6 +919,7 @@ func GetCommands() []cli.Command {
870919
ArgsUsage: common.CreateEnvVars(),
871920
BashComplete: corecommon.CreateBashCompletionFunc(),
872921
Action: groupAddUsersCmd,
922+
Category: userCategory,
873923
},
874924
{
875925
Name: "group-delete",
@@ -881,6 +931,7 @@ func GetCommands() []cli.Command {
881931
ArgsUsage: common.CreateEnvVars(),
882932
BashComplete: corecommon.CreateBashCompletionFunc(),
883933
Action: groupDeleteCmd,
934+
Category: userCategory,
884935
},
885936
{
886937
Name: "access-token-create",
@@ -903,6 +954,7 @@ func GetCommands() []cli.Command {
903954
ArgsUsage: common.CreateEnvVars(),
904955
BashComplete: corecommon.CreateBashCompletionFunc(),
905956
Action: transferSettingsCmd,
957+
Category: transferCategory,
906958
},
907959
{
908960
Name: "transfer-config",
@@ -913,6 +965,7 @@ func GetCommands() []cli.Command {
913965
ArgsUsage: common.CreateEnvVars(),
914966
BashComplete: corecommon.CreateBashCompletionFunc(),
915967
Action: transferConfigCmd,
968+
Category: transferCategory,
916969
},
917970
{
918971
Name: "transfer-config-merge",
@@ -923,6 +976,7 @@ func GetCommands() []cli.Command {
923976
ArgsUsage: common.CreateEnvVars(),
924977
BashComplete: corecommon.CreateBashCompletionFunc(),
925978
Action: transferConfigMergeCmd,
979+
Category: transferCategory,
926980
},
927981
{
928982
Name: "transfer-files",
@@ -933,6 +987,7 @@ func GetCommands() []cli.Command {
933987
ArgsUsage: common.CreateEnvVars(),
934988
BashComplete: corecommon.CreateBashCompletionFunc(),
935989
Action: transferFilesCmd,
990+
Category: transferCategory,
936991
},
937992
{
938993
Name: "transfer-plugin-install",
@@ -943,6 +998,7 @@ func GetCommands() []cli.Command {
943998
ArgsUsage: common.CreateEnvVars(),
944999
BashComplete: corecommon.CreateBashCompletionFunc(),
9451000
Action: dataTransferPluginInstallCmd,
1001+
Category: transferCategory,
9461002
},
9471003
})
9481004
}

0 commit comments

Comments
 (0)