@@ -51,6 +51,7 @@ type configOptions struct {
51
51
services bool
52
52
volumes bool
53
53
networks bool
54
+ models bool
54
55
profiles bool
55
56
images bool
56
57
hash string
@@ -115,6 +116,9 @@ func configCommand(p *ProjectOptions, dockerCli command.Cli) *cobra.Command {
115
116
if opts .networks {
116
117
return runNetworks (ctx , dockerCli , opts )
117
118
}
119
+ if opts .models {
120
+ return runModels (ctx , dockerCli , opts )
121
+ }
118
122
if opts .hash != "" {
119
123
return runHash (ctx , dockerCli , opts )
120
124
}
@@ -152,6 +156,7 @@ func configCommand(p *ProjectOptions, dockerCli command.Cli) *cobra.Command {
152
156
flags .BoolVar (& opts .services , "services" , false , "Print the service names, one per line." )
153
157
flags .BoolVar (& opts .volumes , "volumes" , false , "Print the volume names, one per line." )
154
158
flags .BoolVar (& opts .networks , "networks" , false , "Print the network names, one per line." )
159
+ flags .BoolVar (& opts .models , "models" , false , "Print the model names, one per line." )
155
160
flags .BoolVar (& opts .profiles , "profiles" , false , "Print the profile names, one per line." )
156
161
flags .BoolVar (& opts .images , "images" , false , "Print the image names, one per line." )
157
162
flags .StringVar (& opts .hash , "hash" , "" , "Print the service config hash, one per line." )
@@ -383,6 +388,17 @@ func runNetworks(ctx context.Context, dockerCli command.Cli, opts configOptions)
383
388
return nil
384
389
}
385
390
391
+ func runModels (ctx context.Context , dockerCli command.Cli , opts configOptions ) error {
392
+ project , err := opts .ToProject (ctx , dockerCli , nil , cli .WithoutEnvironmentResolution )
393
+ if err != nil {
394
+ return err
395
+ }
396
+ for n := range project .Models {
397
+ _ , _ = fmt .Fprintln (dockerCli .Out (), n )
398
+ }
399
+ return nil
400
+ }
401
+
386
402
func runHash (ctx context.Context , dockerCli command.Cli , opts configOptions ) error {
387
403
var services []string
388
404
if opts .hash != "*" {
0 commit comments