Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Updated help messages #311

Merged
10 changes: 5 additions & 5 deletions functional/core/core_feature.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"action":"main"
}
],
"result":"It can be used to add formulas, repositories and other objects.."
"result":"Add a new formula repository to ritchie-cli."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Add a new repository of formulas"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix 7e0e7ee

},
{
"entry":"Add new repo",
Expand Down Expand Up @@ -158,7 +158,7 @@
"action":"main"
}
],
"result":"Set objects like credentials, etc."
"result":"Set contexts, credentials and priorities for formula repositories."
},
{
"entry":"Update repo",
Expand All @@ -180,7 +180,7 @@
"action":"main"
}
],
"result":"Add autocomplete for terminal, Available for (bash, zsh)."
"result":"Add autocomplete for terminal, available for (zsh, bash, fish, powershell)."
},
{
"entry":"Completion bash",
Expand Down Expand Up @@ -224,7 +224,7 @@
"action":"main"
}
],
"result":"Delete objects like users, etc."
"result":"Delete a object like context and repository."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the same pattern of set description

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix in 7e0e7ee

},
{
"entry":"Show",
Expand All @@ -235,7 +235,7 @@
"action":"main"
}
],
"result":"Show objects like context, organization etc."
"result":"Show current context."
},
{
"entry":"Help",
Expand Down
13 changes: 4 additions & 9 deletions pkg/cmd/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@ import (
"github.com/spf13/cobra"
)

var descAddLong = `
This command consists of multiple subcommands to interact with ritchie.

It can be used to add formulas, repositories and other objects..
`

// NewAddCmd create a new add instance
func NewAddCmd() *cobra.Command {
return &cobra.Command{
Use: "add SUBCOMMAND",
Short: "add objects",
Long: descAddLong,
Use: "add SUBCOMMAND",
Short: "Add repositories ",
Long: "Add a new formula repository to ritchie-cli.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Add a new repository of formulas"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example: "rit add repo",
}
}
4 changes: 2 additions & 2 deletions pkg/cmd/add_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ func NewAddRepoCmd(
}
cmd := &cobra.Command{
Use: "repo",
Short: "Add a repository.",
Example: "rit add repo ",
Short: "Add a repository",
Example: "rit add repo",
RunE: RunFuncE(addRepo.runStdin(), addRepo.runPrompt()),
}
cmd.LocalFlags()
Expand Down
9 changes: 7 additions & 2 deletions pkg/cmd/autocomplete.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"fmt"
"strings"

"github.com/spf13/cobra"

Expand All @@ -15,17 +16,21 @@ const (
powerShell autocomplete.ShellName = "powershell"
)

var supportedShell = []string{zsh.String(), bash.String(), fish.String(), powerShell.String()}

// autocompleteCmd type for set autocomplete command
type autocompleteCmd struct {
autocomplete.Generator
}

// NewAutocompleteCmd creates a new cmd instance
func NewAutocompleteCmd() *cobra.Command {
shells := strings.Join(supportedShell, ", ")

return &cobra.Command{
Use: "completion SUBCOMMAND",
Short: "Add autocomplete for terminal",
Long: `Add autocomplete for terminal, Available for (bash, zsh).`,
Short: "Add autocomplete for terminal (" + shells + ")",
Long: "Add autocomplete for terminal, available for (" + shells + ").",
Example: "rit completion zsh",
}
}
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import "github.com/spf13/cobra"

func NewBuildCmd() *cobra.Command {
return &cobra.Command{
Use: "build SUB_COMMAND",
Short: "This is a root command, needs a sub command",
Long: `This is a root command, to use it, add a sub command. For example, rit build formula.`,
Use: "build SUB_COMMAND",
Short: "Build formulas - with subcomando formulas",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Build formulas"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix in 7e0e7ee

Long: "This is a root command, to use it, add a sub command.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the same pattern of the add description.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix in 04b4392

Example: "rit build formula",
}
}
}
7 changes: 4 additions & 3 deletions pkg/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import (
// NewCreateCmd creates new cmd instance
func NewCreateCmd() *cobra.Command {
return &cobra.Command{
Use: "create SUBCOMMAND",
Short: "Create objects",
Long: `Create objects like users, etc.`,
Use: "create SUBCOMMAND",
Short: "Create formulas",
Long: "Create a new formula.",
Example: "rit create formula",
}
}
7 changes: 4 additions & 3 deletions pkg/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import "github.com/spf13/cobra"
// NewDeleteCmd create a new delete instance
func NewDeleteCmd() *cobra.Command {
return &cobra.Command{
Use: "delete SUBCOMMAND",
Short: "Delete objects",
Long: `Delete objects like users, etc.`,
Use: "delete SUBCOMMAND",
Short: "Delete objects (contexts, repositories)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the same pattern of set description

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix in 7e0e7ee

Long: "Delete a object like context and repository.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the same pattern of set description

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix in 7e0e7ee

Example: "rit delete context",
}
}
4 changes: 2 additions & 2 deletions pkg/cmd/delete_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ func NewDeleteContextCmd(

cmd := &cobra.Command{
Use: "context",
Short: "Delete context for Ritchie-cli",
Short: "Delete context for ritchie-cli",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to be more clear, ritchie-cli is the program, so maybe you can use delete context for credentials

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, changed in 7e0e7ee

Example: "rit delete context",
RunE: RunFuncE(d.runStdin(), d.runPrompt()),
RunE: RunFuncE(d.runStdin(), d.runPrompt()),
}

cmd.LocalFlags()
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func NewInitCmd(repo formula.RepositoryAdder, git github.Repositories) *cobra.Co

cmd := &cobra.Command{
Use: "init",
Short: "Init rit",
Short: "Initialize rit configuration",
Long: "Initialize rit configuration",
RunE: o.runPrompt(),
}
Expand Down
7 changes: 4 additions & 3 deletions pkg/cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ It can be used to list formulas, repositories and other objects.
// NewListCmd create a new list instance
func NewListCmd() *cobra.Command {
return &cobra.Command{
Use: "list SUBCOMMAND",
Short: "list objects ",
Long: descListLong,
Use: "list SUBCOMMAND",
Short: "List repositories",
Long: "List all formula repositories.",
Example: "rit list repo",
}
}
7 changes: 4 additions & 3 deletions pkg/cmd/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import (
// NewSetCmd creates new cmd instance
func NewSetCmd() *cobra.Command {
return &cobra.Command{
Use: "set SUBCOMMAND",
Short: "Set objects",
Long: `Set objects like credentials, etc.`,
Use: "set SUBCOMMAND",
Short: "Set objects (context, credential, repo-priority)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Set contexts, credentials and priorities

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix 7e0e7ee

Long: "Set contexts, credentials and priorities for formula repositories.",
Example: "rit set context",
}
}
7 changes: 4 additions & 3 deletions pkg/cmd/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import "github.com/spf13/cobra"

func NewShowCmd() *cobra.Command {
return &cobra.Command{
Use: "show SUB_COMMAND",
Short: "Show objects",
Long: `Show objects like context, organization etc.`,
Use: "show SUB_COMMAND",
Short: "Show context",
Long: "Show current context.",
Example: "rit show context",
}
}
13 changes: 4 additions & 9 deletions pkg/cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@ package cmd

import "github.com/spf13/cobra"

var descUpdateLong = `
This command consists of multiple subcommands to interact with ritchie.

It can be used to update formulas repositories and etc.
`

// NewUpdateCmd create a new update instance
func NewUpdateCmd() *cobra.Command {
return &cobra.Command{
Use: "update SUBCOMMAND",
Short: "update objects",
Long: descUpdateLong,
Use: "update SUBCOMMAND",
Short: "Update repositories",
Long: "Update repositories.",
Example: "rit update repo",
}
}