Skip to content

Commit

Permalink
carapace: move descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Dec 24, 2023
1 parent 78362cf commit 0cc9ed3
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmd/carapace/cmd/codegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

var codegenCmd = &cobra.Command{
Use: "--codegen [spec]",
Short: "",
Short: "generate code for spec file",
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
scrape(args[0])
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 @@ -13,7 +13,7 @@ import (

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

var macroCmd = &cobra.Command{
Use: "--macro [macro] ...",
Short: "",
Short: "list or execute macros",
Args: cobra.ArbitraryArgs,
Run: func(cmd *cobra.Command, args []string) {
switch len(args) {
Expand Down
12 changes: 6 additions & 6 deletions cmd/carapace/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,13 @@ func Execute(version string) error {
}

func init() {
rootCmd.Flags().Bool("codegen", false, "generate code for spec file")
rootCmd.Flags().Bool("codegen", false, codegenCmd.Short)
rootCmd.Flags().BoolP("help", "h", false, "help for carapace")
rootCmd.Flags().Bool("list", false, "list completers")
rootCmd.Flags().Bool("macro", false, "list or execute macros")
rootCmd.Flags().Bool("run", false, "run spec")
rootCmd.Flags().Bool("schema", false, "json schema for spec files")
rootCmd.Flags().Bool("style", false, "set style")
rootCmd.Flags().Bool("list", false, listCmd.Short)
rootCmd.Flags().Bool("macro", false, macroCmd.Short)
rootCmd.Flags().Bool("run", false, runCmd.Short)
rootCmd.Flags().Bool("schema", false, schemaCmd.Short)
rootCmd.Flags().Bool("style", false, styleCmd.Short)
rootCmd.Flags().BoolP("version", "v", false, "version for carapace")

rootCmd.MarkFlagsMutuallyExclusive(
Expand Down
2 changes: 1 addition & 1 deletion cmd/carapace/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

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

var schemaCmd = &cobra.Command{
Use: "--codegen",
Short: "",
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
2 changes: 1 addition & 1 deletion cmd/carapace/cmd/style.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

var styleCmd = &cobra.Command{
Use: "--style [config]",
Short: "",
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 0cc9ed3

Please sign in to comment.