Repository: caddyserver/caddy
File: cmd/commands.go (Go)

Code before:

	RegisterCommand(Command{
		Name:  "version",
		Short: "Prints the version",
		Long: `
Prints the version of this Caddy binary.

Version information must be embedded into the binary at compile-time in
order for Caddy to display anything useful with this command. If Caddy
is built from within a version control repository, the Go command will
embed the revision hash if available. However, if Caddy is built in the
way specified by our online documentation (or by using xcaddy), more
detailed version information is printed as given by Go modules.

For more details about the full version string, see the Go module
documentation: https://go.dev/doc/modules/version-numbers
`,
		Func: cmdVersion,
	})

	RegisterCommand(Command{
		Name:  "list-modules",
		Usage: "[--packages] [--versions] [--skip-standard]",
		Short: "Lists the installed Caddy modules",
		CobraFunc: func(cmd *cobra.Command) {
			cmd.Flags().BoolP("packages", "p", false, "Print package paths")
			cmd.Flags().BoolP("versions", "v", false, "Print version information")
			cmd.Flags().BoolP("skip-standard", "s", false, "Skip printing standard modules")
			cmd.RunE = WrapCommandFuncForCobra(cmdListModules)
		},
	})

	RegisterCommand(Command{
		Name:  "build-info",
		Short: "Prints information about this build",
		Func:  cmdBuildInfo,
	})

	RegisterCommand(Command{
		Name:  "environ",
		Short: "Prints the environment",
		Long: `
Prints the environment as seen by this Caddy process.

The environment includes variables set in the system. If your Caddy
configuration uses environment variables (e.g. "{env.VARIABLE}") then
this command can be useful for verifying that the variables will have
the values you expect in your config.

Note that environments may be different depending on how you run Caddy.
Environments for Caddy instances started by service managers such as

Review comment (suggestion):
```suggestion
			cmd.Flags().BoolP("packages", "", false, "Print package paths")
```

Code after:

	RegisterCommand(Command{
		Name:  "version",
		Short: "Prints the version",
		Long: `
Prints the version of this Caddy binary.

Version information must be embedded into the binary at compile-time in
order for Caddy to display anything useful with this command. If Caddy
is built from within a version control repository, the Go command will
embed the revision hash if available. However, if Caddy is built in the
way specified by our online documentation (or by using xcaddy), more
detailed version information is printed as given by Go modules.

For more details about the full version string, see the Go module
documentation: https://go.dev/doc/modules/version-numbers
`,
		Func: cmdVersion,
	})

	RegisterCommand(Command{
		Name:  "list-modules",
		Usage: "[--packages] [--versions] [--skip-standard]",
		Short: "Lists the installed Caddy modules",
		CobraFunc: func(cmd *cobra.Command) {
			cmd.Flags().BoolP("packages", "", false, "Print package paths")
			cmd.Flags().BoolP("versions", "", false, "Print version information")
			cmd.Flags().BoolP("skip-standard", "s", false, "Skip printing standard modules")
			cmd.RunE = WrapCommandFuncForCobra(cmdListModules)
		},
	})

	RegisterCommand(Command{
		Name:  "build-info",
		Short: "Prints information about this build",
		Func:  cmdBuildInfo,
	})

	RegisterCommand(Command{
		Name:  "environ",
		Short: "Prints the environment",
		Long: `
Prints the environment as seen by this Caddy process.

The environment includes variables set in the system. If your Caddy
configuration uses environment variables (e.g. "{env.VARIABLE}") then
this command can be useful for verifying that the variables will have
the values you expect in your config.

Note that environments may be different depending on how you run Caddy.
Environments for Caddy instances started by service managers such as