diff --git a/functional/single/core/core_feature.json b/functional/single/core/core_feature.json index d223c23d8..19b3235d6 100644 --- a/functional/single/core/core_feature.json +++ b/functional/single/core/core_feature.json @@ -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 objects like contexts and repo" }, { "entry":"Show", @@ -235,7 +235,7 @@ "action":"main" } ], - "result":"Show objects like context, organization etc." + "result":"Show contexts" }, { "entry":"Help", diff --git a/functional/team/core/core_feature.json b/functional/team/core/core_feature.json index f934daae2..02f0f924f 100644 --- a/functional/team/core/core_feature.json +++ b/functional/team/core/core_feature.json @@ -82,7 +82,7 @@ "action":"main" } ], - "result":"Delete objects like users, etc." + "result":"Delete objects like contexts and repo" }, { "entry":"Delete context", @@ -115,7 +115,7 @@ "action":"main" } ], - "result":"Show objects like context, organization etc." + "result":"Show contexts" }, { "entry":"Show context", @@ -148,7 +148,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", @@ -251,7 +251,7 @@ "action":"main" } ], - "result":"It can be used to update formulas repositories and etc." + "result":"It can be used to update formulas, repositories and etc." }, { "entry":"Update repo", diff --git a/pkg/cmd/add.go b/pkg/cmd/add.go index 14d7635d8..5ae33d18f 100644 --- a/pkg/cmd/add.go +++ b/pkg/cmd/add.go @@ -14,7 +14,7 @@ It can be used to add formulas, repositories and other objects.. func NewAddCmd() *cobra.Command { return &cobra.Command{ Use: "add SUBCOMMAND", - Short: "add objects", + Short: "Add repositories", Long: descAddLong, } } diff --git a/pkg/cmd/autocomplete.go b/pkg/cmd/autocomplete.go index 679f20bb4..cef682dfa 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,11 @@ 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..6f7bb56bb 100644 --- a/pkg/cmd/build.go +++ b/pkg/cmd/build.go @@ -2,10 +2,11 @@ package cmd import "github.com/spf13/cobra" +// NewBuildCmd creates new cmd instance of build command func NewBuildCmd() *cobra.Command { return &cobra.Command{ Use: "build SUB_COMMAND", - Short: "This is a root command, needs a sub command", + Short: "Build formulas", Long: `This is a root command, to use it, add a sub command. For example, rit build formula.`, } -} \ No newline at end of file +} diff --git a/pkg/cmd/create.go b/pkg/cmd/create.go index 380f1e7c4..c683e0444 100644 --- a/pkg/cmd/create.go +++ b/pkg/cmd/create.go @@ -8,7 +8,7 @@ import ( func NewCreateCmd() *cobra.Command { return &cobra.Command{ Use: "create SUBCOMMAND", - Short: "Create objects", + Short: "Create formulas", Long: `Create objects like users, etc.`, } } diff --git a/pkg/cmd/create_formula.go b/pkg/cmd/create_formula.go index c2ad7e51c..ce7776eee 100644 --- a/pkg/cmd/create_formula.go +++ b/pkg/cmd/create_formula.go @@ -34,7 +34,7 @@ type createFormulaCmd struct { inList prompt.InputList } -// CreateFormulaCmd creates a new cmd instance +// NewCreateFormulaCmd creates a new cmd instance func NewCreateFormulaCmd( homeDir string, formula formula.CreateBuilder, diff --git a/pkg/cmd/delete.go b/pkg/cmd/delete.go index 11b2c7722..247ed2773 100644 --- a/pkg/cmd/delete.go +++ b/pkg/cmd/delete.go @@ -6,7 +6,7 @@ import "github.com/spf13/cobra" func NewDeleteCmd() *cobra.Command { return &cobra.Command{ Use: "delete SUBCOMMAND", - Short: "Delete objects", - Long: `Delete objects like users, etc.`, + Short: "Delete objects (contexts, repositories)", + Long: `Delete objects like contexts and repo`, } } diff --git a/pkg/cmd/delete_context.go b/pkg/cmd/delete_context.go index 753004bc8..1099a240e 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 ritchie-cli", Example: "rit delete context", - RunE: RunFuncE(d.runStdin(), d.runPrompt()), + RunE: RunFuncE(d.runStdin(), d.runPrompt()), } cmd.LocalFlags() diff --git a/pkg/cmd/delete_repo.go b/pkg/cmd/delete_repo.go index b4143e775..fd5765d04 100644 --- a/pkg/cmd/delete_repo.go +++ b/pkg/cmd/delete_repo.go @@ -35,7 +35,7 @@ func NewDeleteRepoCmd(dl formula.RepoDelLister, il prompt.InputList, ib prompt.I cmd := &cobra.Command{ Use: "repo [NAME_REPOSITORY]", - Short: "Delete a repository.", + Short: "Delete a repository", Example: "rit delete repo [NAME_REPOSITORY]", RunE: RunFuncE(d.runStdin(), d.runPrompt()), } diff --git a/pkg/cmd/init.go b/pkg/cmd/init.go index 8726dbd19..a73450cf2 100644 --- a/pkg/cmd/init.go +++ b/pkg/cmd/init.go @@ -72,7 +72,7 @@ func NewTeamInitCmd( func newInitCmd(stdinFunc, promptFunc CommandRunnerFunc) *cobra.Command { cmd := &cobra.Command{ Use: "init", - Short: "Init rit", + Short: "Initialize rit configuration", Long: "Initialize rit configuration", RunE: RunFuncE(stdinFunc, promptFunc), } diff --git a/pkg/cmd/list.go b/pkg/cmd/list.go index b6d527c8e..37016b67e 100644 --- a/pkg/cmd/list.go +++ b/pkg/cmd/list.go @@ -12,7 +12,7 @@ It can be used to list formulas, repositories and other objects. func NewListCmd() *cobra.Command { return &cobra.Command{ Use: "list SUBCOMMAND", - Short: "list objects ", + Short: "List repositories", Long: descListLong, } } diff --git a/pkg/cmd/logout.go b/pkg/cmd/logout.go index 72a4b8203..738094a87 100644 --- a/pkg/cmd/logout.go +++ b/pkg/cmd/logout.go @@ -11,6 +11,7 @@ type logoutCmd struct { security.LogoutManager } +// NewLogoutCmd creates new cmd instance of logout command func NewLogoutCmd(lm security.LogoutManager) *cobra.Command { l := logoutCmd{lm} return &cobra.Command{ diff --git a/pkg/cmd/set.go b/pkg/cmd/set.go index c1eac97bc..f642ff829 100644 --- a/pkg/cmd/set.go +++ b/pkg/cmd/set.go @@ -8,7 +8,7 @@ import ( func NewSetCmd() *cobra.Command { return &cobra.Command{ Use: "set SUBCOMMAND", - Short: "Set objects", + Short: "Set objects (context, credential)", Long: `Set objects like credentials, etc.`, } } diff --git a/pkg/cmd/show.go b/pkg/cmd/show.go index 3447cc401..e4491d24b 100644 --- a/pkg/cmd/show.go +++ b/pkg/cmd/show.go @@ -2,10 +2,11 @@ package cmd import "github.com/spf13/cobra" +// NewShowCmd creates new cmd instance of show command func NewShowCmd() *cobra.Command { return &cobra.Command{ Use: "show SUB_COMMAND", - Short: "Show objects", - Long: `Show objects like context, organization etc.`, + Short: "Show contexts", + Long: `Show contexts`, } } diff --git a/pkg/cmd/update.go b/pkg/cmd/update.go index 4ae5d4bd5..b1b939c1f 100644 --- a/pkg/cmd/update.go +++ b/pkg/cmd/update.go @@ -5,14 +5,14 @@ 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. +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", + Short: "Update repositories", Long: descUpdateLong, } } diff --git a/pkg/cmd/upgrade.go b/pkg/cmd/upgrade.go index aaf9c8b51..54c59d5a8 100644 --- a/pkg/cmd/upgrade.go +++ b/pkg/cmd/upgrade.go @@ -9,6 +9,7 @@ import ( "github.com/ZupIT/ritchie-cli/pkg/version" ) +// UpgradeCmd type for set upgrade command type UpgradeCmd struct { edition api.Edition upgrade.Manager @@ -16,12 +17,13 @@ type UpgradeCmd struct { upgrade.UrlFinder } +// NewUpgradeCmd creates new cmd instance of upgrade command func NewUpgradeCmd(e api.Edition, r version.Resolver, m upgrade.Manager, uf upgrade.UrlFinder) *cobra.Command { u := UpgradeCmd{ - edition: e, - Manager: m, - resolver: r, + edition: e, + Manager: m, + resolver: r, UrlFinder: uf, } @@ -37,12 +39,12 @@ func (u UpgradeCmd) runFunc() CommandRunnerFunc { return func(cmd *cobra.Command, args []string) error { err := u.resolver.UpdateCache() if err != nil { - return prompt.NewError(err.Error()+"\n") + return prompt.NewError(err.Error() + "\n") } upgradeUrl := u.Url(u.edition, u.resolver) err = u.Run(upgradeUrl) if err != nil { - return prompt.NewError(err.Error()+"\n") + return prompt.NewError(err.Error() + "\n") } prompt.Success("Rit upgraded with success") return nil