mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-25 19:14:50 -08:00
fix(cli): correct help text
This commit is contained in:
parent
2c982b2f0d
commit
472bd6fba7
|
@ -2,16 +2,15 @@ package cli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
// getCmd represents the get command
|
// getCmd represents the get command
|
||||||
var disableCmd = &cobra.Command{
|
var disableCmd = &cobra.Command{
|
||||||
Use: fmt.Sprintf(toggleUse, "disable", strings.Join(toggleArgs, "|")),
|
Use: fmt.Sprintf(toggleUse, "disable"),
|
||||||
Short: "Disable a feature",
|
Short: "Disable a feature",
|
||||||
Long: fmt.Sprintf(toggleLong, "Disable", "disable"),
|
Long: fmt.Sprintf(toggleLong, "Disable"),
|
||||||
ValidArgs: toggleArgs,
|
ValidArgs: toggleArgs,
|
||||||
Args: NoArgsOrOneValidArg,
|
Args: NoArgsOrOneValidArg,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
|
|
@ -12,23 +12,21 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
toggleUse = "%s [%s]"
|
toggleHelpText = `%s one of the following features:
|
||||||
toggleLong = `%s a feature
|
`
|
||||||
|
|
||||||
This command is used to %s one of the following features:
|
|
||||||
|
|
||||||
- upgradenotice`
|
|
||||||
toggleArgs = []string{
|
toggleArgs = []string{
|
||||||
config.UPGRADENOTICE,
|
config.UPGRADENOTICE,
|
||||||
config.AUTOUPGRADE,
|
config.AUTOUPGRADE,
|
||||||
}
|
}
|
||||||
|
toggleUse = fmt.Sprintf("%%s [%s]", strings.Join(toggleArgs, "|"))
|
||||||
|
toggleLong = strings.Join(append([]string{toggleHelpText}, toggleArgs...), "\n- ")
|
||||||
)
|
)
|
||||||
|
|
||||||
// getCmd represents the get command
|
// getCmd represents the get command
|
||||||
var enableCmd = &cobra.Command{
|
var enableCmd = &cobra.Command{
|
||||||
Use: fmt.Sprintf(toggleUse, "enable", strings.Join(toggleArgs, "|")),
|
Use: fmt.Sprintf(toggleUse, "enable"),
|
||||||
Short: "Enable a feature",
|
Short: "Enable a feature",
|
||||||
Long: fmt.Sprintf(toggleLong, "Enable", "enable"),
|
Long: fmt.Sprintf(toggleLong, "Enable"),
|
||||||
ValidArgs: toggleArgs,
|
ValidArgs: toggleArgs,
|
||||||
Args: NoArgsOrOneValidArg,
|
Args: NoArgsOrOneValidArg,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
|
Loading…
Reference in a new issue