@@ -46,6 +46,7 @@ type convertOptions struct {
46
46
noInterpolate bool
47
47
services bool
48
48
volumes bool
49
+ profiles bool
49
50
hash string
50
51
}
51
52
@@ -76,6 +77,9 @@ func convertCommand(p *projectOptions) *cobra.Command {
76
77
if opts .hash != "" {
77
78
return runHash (opts )
78
79
}
80
+ if opts .profiles {
81
+ return runProfiles (opts )
82
+ }
79
83
80
84
return runConvert (cmd .Context (), opts , args )
81
85
},
@@ -88,6 +92,7 @@ func convertCommand(p *projectOptions) *cobra.Command {
88
92
89
93
flags .BoolVar (& opts .services , "services" , false , "Print the service names, one per line." )
90
94
flags .BoolVar (& opts .volumes , "volumes" , false , "Print the volume names, one per line." )
95
+ flags .BoolVar (& opts .profiles , "profiles" , false , "Print the profile names, one per line." )
91
96
flags .StringVar (& opts .hash , "hash" , "" , "Print the service config hash, one per line." )
92
97
93
98
// add flags for hidden backends
@@ -189,3 +194,20 @@ func runHash(opts convertOptions) error {
189
194
}
190
195
return nil
191
196
}
197
+
198
+ func runProfiles (opts convertOptions ) error {
199
+ profiles := map [string ]struct {}{}
200
+ project , err := opts .toProject (nil )
201
+ if err != nil {
202
+ return err
203
+ }
204
+ for _ , s := range project .Services {
205
+ for _ , p := range s .Profiles {
206
+ profiles [p ] = struct {}{}
207
+ }
208
+ }
209
+ for _ , p := range profiles {
210
+ fmt .Println (p )
211
+ }
212
+ return nil
213
+ }
0 commit comments