Skip to content

Commit

Permalink
carapace: updated command descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Mar 1, 2024
1 parent de860c8 commit 13e8edd
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 17 deletions.
5 changes: 2 additions & 3 deletions cmd/carapace/cmd/clearCache.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ import (

var clearCacheCmd = &cobra.Command{
Use: "--clear-cache",
Short: "",
Short: "clear caches",
RunE: func(cmd *cobra.Command, args []string) error {
cacheDir, err := xdg.UserCacheDir()
if err != nil {
return err
}
path := cacheDir + "/carapace"
return os.RemoveAll(path)
return os.RemoveAll(cacheDir + "/carapace")
},
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/carapace/cmd/codegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
)

var codegenCmd = &cobra.Command{
Use: "--codegen [spec]",
Short: "",
Use: "--codegen spec",
Short: "generate code for spec file",
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return codegen(args[0])
Expand Down
4 changes: 2 additions & 2 deletions cmd/carapace/cmd/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
)

var diffCmd = &cobra.Command{
Use: "--diff",
Short: "",
Use: "--diff command[/bridge] ...args",
Short: "diff completion",
Args: cobra.MinimumNArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
var stdout, stderr bytes.Buffer
Expand Down
2 changes: 1 addition & 1 deletion cmd/carapace/cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

var listCmd = &cobra.Command{
Use: "--list",
Short: "",
Short: "list completers",
Args: cobra.ArbitraryArgs,
Run: func(cmd *cobra.Command, args []string) {
switch cmd.Flag("format").Value.String() {
Expand Down
4 changes: 2 additions & 2 deletions cmd/carapace/cmd/macro.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
)

var macroCmd = &cobra.Command{
Use: "--macro [macro] ...",
Short: "",
Use: "--macro [macro] [...args]",
Short: "list or execute macros",
Args: cobra.ArbitraryArgs,
Run: func(cmd *cobra.Command, args []string) {
switch len(args) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/carapace/cmd/macros_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ func TestMacros(t *testing.T) {
Expect(carapace.ActionStyledValues(
"Green", "color2",
"Grey", "color8",
).Usage("--macro [macro] ..."))
).Usage("--macro [macro] [...args]"))
})
}
4 changes: 2 additions & 2 deletions cmd/carapace/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
)

var runCmd = &cobra.Command{
Use: "--run",
Short: "",
Use: "--run spec ...args",
Short: "run spec",
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
_, spec, err := loadSpec(args[0])
Expand Down
4 changes: 2 additions & 2 deletions cmd/carapace/cmd/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
)

var schemaCmd = &cobra.Command{
Use: "--codegen",
Short: "",
Use: "--codegen spec",
Short: "json schema for spec files",
Run: func(cmd *cobra.Command, args []string) {
if schema, err := spec.Schema(); err != nil {
fmt.Fprintln(cmd.ErrOrStderr(), err.Error()) // TODO fail / exit 1 ?
Expand Down
4 changes: 2 additions & 2 deletions cmd/carapace/cmd/style.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
)

var styleCmd = &cobra.Command{
Use: "--style [config]",
Short: "",
Use: "--style key=value",
Short: "set style",
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
if err := setStyle(args[0]); err != nil {
Expand Down

0 comments on commit 13e8edd

Please sign in to comment.