diff --git a/cmd/commandfuncs.go b/cmd/commandfuncs.go index cc3f65c70a99..4b2b2d0d7303 100644 --- a/cmd/commandfuncs.go +++ b/cmd/commandfuncs.go @@ -360,6 +360,7 @@ func cmdBuildInfo(fl Flags) (int, error) { func cmdListModules(fl Flags) (int, error) { packages := fl.Bool("packages") versions := fl.Bool("versions") + skipStandard := fl.Bool("skip-standard") printModuleInfo := func(mi moduleInfo) { fmt.Print(mi.caddyModuleID) @@ -388,12 +389,17 @@ func cmdListModules(fl Flags) (int, error) { return caddy.ExitCodeSuccess, nil } - if len(standard) > 0 { - for _, mod := range standard { - printModuleInfo(mod) + // Standard modules (always shipped with Caddy) + if !skipStandard { + if len(standard) > 0 { + for _, mod := range standard { + printModuleInfo(mod) + } } + fmt.Printf("\n Standard modules: %d\n", len(standard)) } - fmt.Printf("\n Standard modules: %d\n", len(standard)) + + // Non-standard modules (third party plugins) if len(nonstandard) > 0 { if len(standard) > 0 { fmt.Println() @@ -403,6 +409,8 @@ func cmdListModules(fl Flags) (int, error) { } } fmt.Printf("\n Non-standard modules: %d\n", len(nonstandard)) + + // Unknown modules (couldn't get Caddy module info) if len(unknown) > 0 { if len(standard) > 0 || len(nonstandard) > 0 { fmt.Println() diff --git a/cmd/commands.go b/cmd/commands.go index 7b184fd79b9f..f562430456d9 100644 --- a/cmd/commands.go +++ b/cmd/commands.go @@ -208,6 +208,7 @@ config file; otherwise the default is assumed.`, fs := flag.NewFlagSet("list-modules", flag.ExitOnError) fs.Bool("packages", false, "Print package paths") fs.Bool("versions", false, "Print version information") + fs.Bool("skip-standard", false, "Skip printing standard modules") return fs }(), })