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

Code before:
`,
		CobraFunc: func(cmd *cobra.Command) {
			cmd.Flags().StringP("config", "c", "", "Configuration file to use to parse the admin address, if --address is not used")
			cmd.Flags().StringP("adapter", "a", "", "Name of config adapter to apply (when --config is used)")
			cmd.Flags().StringP("address", "d", "", "The address to use to reach the admin API endpoint, if not the default")
			cmd.RunE = WrapCommandFuncForCobra(cmdStop)
		},
	})

	RegisterCommand(Command{
		Name:  "reload",
		Usage: "--config <path> [--adapter <name>] [--address <interface>]",
		Short: "Changes the config of the running Caddy instance",
		Long: `
Gives the running Caddy instance a new configuration. This has the same effect
as POSTing a document to the /load API endpoint, but is convenient for simple
workflows revolving around config files.

Since the admin endpoint is configurable, the endpoint configuration is loaded
from the --address flag if specified; otherwise it is loaded from the given
config file; otherwise the default is assumed.
`,
		CobraFunc: func(cmd *cobra.Command) {
			cmd.Flags().StringP("config", "c", "", "Configuration file (required)")
			cmd.Flags().StringP("adapter", "a", "", "Name of config adapter to apply")
			cmd.Flags().StringP("address", "d", "", "Address of the administration listener, if different from config")
			cmd.Flags().BoolP("force", "f", false, "Force config reload, even if it is the same")
			cmd.RunE = WrapCommandFuncForCobra(cmdReload)
		},
	})

	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{

Review comment (suggestion):
```suggestion
			cmd.Flags().StringP("address", "", "", "Address of the administration listener, if different from config")
```

Code after:
`,
		CobraFunc: func(cmd *cobra.Command) {
			cmd.Flags().StringP("config", "c", "", "Configuration file to use to parse the admin address, if --address is not used")
			cmd.Flags().StringP("adapter", "a", "", "Name of config adapter to apply (when --config is used)")
			cmd.Flags().StringP("address", "", "", "The address to use to reach the admin API endpoint, if not the default")
			cmd.RunE = WrapCommandFuncForCobra(cmdStop)
		},
	})

	RegisterCommand(Command{
		Name:  "reload",
		Usage: "--config <path> [--adapter <name>] [--address <interface>]",
		Short: "Changes the config of the running Caddy instance",
		Long: `
Gives the running Caddy instance a new configuration. This has the same effect
as POSTing a document to the /load API endpoint, but is convenient for simple
workflows revolving around config files.

Since the admin endpoint is configurable, the endpoint configuration is loaded
from the --address flag if specified; otherwise it is loaded from the given
config file; otherwise the default is assumed.
`,
		CobraFunc: func(cmd *cobra.Command) {
			cmd.Flags().StringP("config", "c", "", "Configuration file (required)")
			cmd.Flags().StringP("adapter", "a", "", "Name of config adapter to apply")
			cmd.Flags().StringP("address", "", "", "Address of the administration listener, if different from config")
			cmd.Flags().BoolP("force", "f", false, "Force config reload, even if it is the same")
			cmd.RunE = WrapCommandFuncForCobra(cmdReload)
		},
	})

	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{