fix: defer doctor i18n.T() to AddDoctorCommands
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
d67295ad2a
commit
5ebdc602d1
2 changed files with 7 additions and 4 deletions
|
|
@ -10,9 +10,14 @@
|
||||||
// Provides platform-specific installation instructions for missing tools.
|
// Provides platform-specific installation instructions for missing tools.
|
||||||
package doctor
|
package doctor
|
||||||
|
|
||||||
import "github.com/spf13/cobra"
|
import (
|
||||||
|
"forge.lthn.ai/core/go-i18n"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
// AddDoctorCommands registers the 'doctor' command and all subcommands.
|
// AddDoctorCommands registers the 'doctor' command and all subcommands.
|
||||||
func AddDoctorCommands(root *cobra.Command) {
|
func AddDoctorCommands(root *cobra.Command) {
|
||||||
|
doctorCmd.Short = i18n.T("cmd.doctor.short")
|
||||||
|
doctorCmd.Long = i18n.T("cmd.doctor.long")
|
||||||
root.AddCommand(doctorCmd)
|
root.AddCommand(doctorCmd)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,7 @@ var (
|
||||||
var doctorVerbose bool
|
var doctorVerbose bool
|
||||||
|
|
||||||
var doctorCmd = &cobra.Command{
|
var doctorCmd = &cobra.Command{
|
||||||
Use: "doctor",
|
Use: "doctor",
|
||||||
Short: i18n.T("cmd.doctor.short"),
|
|
||||||
Long: i18n.T("cmd.doctor.long"),
|
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
return runDoctor(doctorVerbose)
|
return runDoctor(doctorVerbose)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue