diff --git a/functional/core/core_feature.json b/functional/core/core_feature.json index d223c23d8..2522268f2 100644 --- a/functional/core/core_feature.json +++ b/functional/core/core_feature.json @@ -63,7 +63,7 @@ "action":"main" } ], - "result":"It can be used to add formulas, repositories and other objects.." + "result":"Add a new repository of formulas" }, { "entry":"Add new repo", @@ -158,7 +158,7 @@ "action":"main" } ], - "result":"Set objects like credentials, etc." + "result":"Set contexts, credentials and priorities for formula repositories." }, { "entry":"Update repo", @@ -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", @@ -224,7 +224,7 @@ "action":"main" } ], - "result":"Delete objects like users, etc." + "result":"Delete contexts and repositories." }, { "entry":"Show", @@ -235,7 +235,7 @@ "action":"main" } ], - "result":"Show objects like context, organization etc." + "result":"Show current context." }, { "entry":"Help", diff --git a/pkg/cmd/add.go b/pkg/cmd/add.go index 14d7635d8..5739fd97e 100644 --- a/pkg/cmd/add.go +++ b/pkg/cmd/add.go @@ -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 repository of formulas", + Example: "rit add repo", } } diff --git a/pkg/cmd/add_repo.go b/pkg/cmd/add_repo.go index 41a6acc8d..bd7cdda8a 100644 --- a/pkg/cmd/add_repo.go +++ b/pkg/cmd/add_repo.go @@ -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() diff --git a/pkg/cmd/autocomplete.go b/pkg/cmd/autocomplete.go index 679f20bb4..c01296aaa 100644 --- a/pkg/cmd/autocomplete.go +++ b/pkg/cmd/autocomplete.go @@ -2,6 +2,7 @@ package cmd import ( "fmt" + "strings" "github.com/spf13/cobra" @@ -15,6 +16,8 @@ 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 @@ -22,10 +25,12 @@ type autocompleteCmd struct { // 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", } } diff --git a/pkg/cmd/build.go b/pkg/cmd/build.go index 49cfcf168..74881397a 100644 --- a/pkg/cmd/build.go +++ b/pkg/cmd/build.go @@ -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", + Long: "Build formula with latest changes.", + Example: "rit build formula", } -} \ No newline at end of file +} diff --git a/pkg/cmd/create.go b/pkg/cmd/create.go index 380f1e7c4..fb25e5354 100644 --- a/pkg/cmd/create.go +++ b/pkg/cmd/create.go @@ -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", } } diff --git a/pkg/cmd/delete.go b/pkg/cmd/delete.go index 11b2c7722..93adc860a 100644 --- a/pkg/cmd/delete.go +++ b/pkg/cmd/delete.go @@ -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 contexts and repositories", + Long: "Delete contexts and repositories.", + Example: "rit delete context", } } diff --git a/pkg/cmd/delete_context.go b/pkg/cmd/delete_context.go index 753004bc8..596665f6a 100644 --- a/pkg/cmd/delete_context.go +++ b/pkg/cmd/delete_context.go @@ -31,9 +31,9 @@ func NewDeleteContextCmd( cmd := &cobra.Command{ Use: "context", - Short: "Delete context for Ritchie-cli", + Short: "Delete context for credentials", Example: "rit delete context", - RunE: RunFuncE(d.runStdin(), d.runPrompt()), + RunE: RunFuncE(d.runStdin(), d.runPrompt()), } cmd.LocalFlags() diff --git a/pkg/cmd/init.go b/pkg/cmd/init.go index e6e8727a5..830fc66af 100644 --- a/pkg/cmd/init.go +++ b/pkg/cmd/init.go @@ -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(), } diff --git a/pkg/cmd/list.go b/pkg/cmd/list.go index b6d527c8e..98da89829 100644 --- a/pkg/cmd/list.go +++ b/pkg/cmd/list.go @@ -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", } } diff --git a/pkg/cmd/set.go b/pkg/cmd/set.go index c1eac97bc..e7d76ee2d 100644 --- a/pkg/cmd/set.go +++ b/pkg/cmd/set.go @@ -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 contexts, credentials and priorities", + Long: "Set contexts, credentials and priorities for formula repositories.", + Example: "rit set context", } } diff --git a/pkg/cmd/show.go b/pkg/cmd/show.go index 3447cc401..8a22ba35d 100644 --- a/pkg/cmd/show.go +++ b/pkg/cmd/show.go @@ -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", } } diff --git a/pkg/cmd/update.go b/pkg/cmd/update.go index 4ae5d4bd5..6e0a4277a 100644 --- a/pkg/cmd/update.go +++ b/pkg/cmd/update.go @@ -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", } }