Skip to content

Commit f5f5e90

Browse files
authored
Merge pull request #3187 from carapace-sh/task-updates-v3.46.4
task: updates from v3.46.4
2 parents f059a64 + a68e67d commit f5f5e90

File tree

7 files changed

+147
-32
lines changed

7 files changed

+147
-32
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var completionCmd = &cobra.Command{
9+
Use: "completion",
10+
Short: "Generate the autocompletion script for the specified shell",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(completionCmd).Standalone()
16+
17+
rootCmd.AddCommand(completionCmd)
18+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var completion_bashCmd = &cobra.Command{
9+
Use: "bash",
10+
Short: "Generate the autocompletion script for bash",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(completion_bashCmd).Standalone()
16+
17+
completion_bashCmd.Flags().Bool("no-descriptions", false, "disable completion descriptions")
18+
completionCmd.AddCommand(completion_bashCmd)
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var completion_fishCmd = &cobra.Command{
9+
Use: "fish",
10+
Short: "Generate the autocompletion script for fish",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(completion_fishCmd).Standalone()
16+
17+
completion_fishCmd.Flags().Bool("no-descriptions", false, "disable completion descriptions")
18+
completionCmd.AddCommand(completion_fishCmd)
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var completion_powershellCmd = &cobra.Command{
9+
Use: "powershell",
10+
Short: "Generate the autocompletion script for powershell",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(completion_powershellCmd).Standalone()
16+
17+
completion_powershellCmd.Flags().Bool("no-descriptions", false, "disable completion descriptions")
18+
completionCmd.AddCommand(completion_powershellCmd)
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var completion_zshCmd = &cobra.Command{
9+
Use: "zsh",
10+
Short: "Generate the autocompletion script for zsh",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(completion_zshCmd).Standalone()
16+
17+
completion_zshCmd.Flags().Bool("no-descriptions", false, "disable completion descriptions")
18+
completionCmd.AddCommand(completion_zshCmd)
19+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var helpCmd = &cobra.Command{
9+
Use: "help [command]",
10+
Short: "Help about any command",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(helpCmd).Standalone()
16+
17+
rootCmd.AddCommand(helpCmd)
18+
}

completers/common/task_completer/cmd/root.go

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,41 +16,44 @@ var rootCmd = &cobra.Command{
1616
func Execute() error {
1717
return rootCmd.Execute()
1818
}
19+
1920
func init() {
2021
carapace.Gen(rootCmd).Standalone()
2122

22-
rootCmd.Flags().BoolP("color", "c", false, "Colored output. Enabled by default. Set flag to false or use NO_COLOR=1 to disable.")
23-
rootCmd.Flags().String("completion", "", "Generates shell completion script.")
24-
rootCmd.Flags().StringP("concurrency", "C", "", "Limit number of tasks to run concurrently.")
25-
rootCmd.Flags().StringP("dir", "d", "", "Sets the directory in which Task will execute and look for a Taskfile.")
26-
rootCmd.Flags().BoolP("dry", "n", false, "Compiles and prints tasks in the order that they would be run, without executing them.")
27-
rootCmd.Flags().BoolP("exit-code", "x", false, "Pass-through the exit code of the task command.")
28-
rootCmd.Flags().Bool("experiments", false, "Lists all the available experiments and whether or not they are enabled.")
29-
rootCmd.Flags().BoolP("force", "f", false, "Forces execution even when the task is up-to-date.")
30-
rootCmd.Flags().BoolP("global", "g", false, "Runs global Taskfile, from $HOME/{T,t}askfile.{yml,yaml}.")
31-
rootCmd.Flags().BoolP("help", "h", false, "Shows Task usage.")
32-
rootCmd.Flags().BoolP("init", "i", false, "Creates a new Taskfile.yml in the current folder.")
33-
rootCmd.Flags().Bool("insecure", false, "Forces Task to download Taskfiles over insecure connections.")
34-
rootCmd.Flags().StringP("interval", "I", "", "Interval to watch for changes.")
35-
rootCmd.Flags().BoolP("json", "j", false, "Formats task list as JSON.")
36-
rootCmd.Flags().BoolP("list", "l", false, "Lists tasks with description of current Taskfile.")
37-
rootCmd.Flags().BoolP("list-all", "a", false, "Lists tasks with or without a description.")
38-
rootCmd.Flags().Bool("nested", false, "Nest namespaces when listing tasks as JSON")
39-
rootCmd.Flags().Bool("no-status", false, "Ignore status when listing tasks as JSON")
40-
rootCmd.Flags().StringP("output", "o", "", "Sets output style: [interleaved|group|prefixed].")
41-
rootCmd.Flags().String("output-group-begin", "", "Message template to print before a task's grouped output.")
42-
rootCmd.Flags().String("output-group-end", "", "Message template to print after a task's grouped output.")
43-
rootCmd.Flags().Bool("output-group-error-only", false, "Swallow output from successful tasks.")
44-
rootCmd.Flags().BoolP("parallel", "p", false, "Executes tasks provided on command line in parallel.")
45-
rootCmd.Flags().BoolP("silent", "s", false, "Disables echoing.")
46-
rootCmd.Flags().String("sort", "", "Changes the order of the tasks when listed. [default|alphanumeric|none].")
47-
rootCmd.Flags().Bool("status", false, "Exits with non-zero exit code if any of the given tasks is not up-to-date.")
48-
rootCmd.Flags().Bool("summary", false, "Show summary about a task.")
49-
rootCmd.Flags().StringP("taskfile", "t", "", "Choose which Taskfile to run. Defaults to \"Taskfile.yml\".")
50-
rootCmd.Flags().BoolP("verbose", "v", false, "Enables verbose mode.")
51-
rootCmd.Flags().Bool("version", false, "Show Task version.")
52-
rootCmd.Flags().BoolP("watch", "w", false, "Enables watch of the given task.")
53-
rootCmd.Flags().BoolP("yes", "y", false, "Assume \"yes\" as answer to all prompts.")
23+
rootCmd.PersistentFlags().BoolP("color", "c", false, "Colored output. Enabled by default. Set flag to false or use NO_COLOR=1 to disable.")
24+
rootCmd.PersistentFlags().String("completion", "", "Generates shell completion script.")
25+
rootCmd.PersistentFlags().StringP("concurrency", "C", "", "Limit number of tasks to run concurrently.")
26+
rootCmd.PersistentFlags().StringP("dir", "d", "", "Sets the directory in which Task will execute and look for a Taskfile.")
27+
rootCmd.PersistentFlags().Bool("disable-fuzzy", false, "Disables fuzzy matching for task names.")
28+
rootCmd.PersistentFlags().BoolP("dry", "n", false, "Compiles and prints tasks in the order that they would be run, without executing them.")
29+
rootCmd.PersistentFlags().BoolP("exit-code", "x", false, "Pass-through the exit code of the task command.")
30+
rootCmd.PersistentFlags().Bool("experiments", false, "Lists all the available experiments and whether or not they are enabled.")
31+
rootCmd.PersistentFlags().BoolP("failfast", "F", false, "When running tasks in parallel, stop all tasks if one fails.")
32+
rootCmd.PersistentFlags().BoolP("force", "f", false, "Forces execution even when the task is up-to-date.")
33+
rootCmd.PersistentFlags().BoolP("global", "g", false, "Runs global Taskfile, from $HOME/{T,t}askfile.{yml,yaml}.")
34+
rootCmd.PersistentFlags().BoolP("help", "h", false, "Shows Task usage.")
35+
rootCmd.PersistentFlags().BoolP("init", "i", false, "Creates a new Taskfile.yml in the current folder.")
36+
rootCmd.PersistentFlags().Bool("insecure", false, "Forces Task to download Taskfiles over insecure connections.")
37+
rootCmd.PersistentFlags().StringP("interval", "I", "", "Interval to watch for changes.")
38+
rootCmd.PersistentFlags().BoolP("json", "j", false, "Formats task list as JSON.")
39+
rootCmd.PersistentFlags().BoolP("list", "l", false, "Lists tasks with description of current Taskfile.")
40+
rootCmd.PersistentFlags().BoolP("list-all", "a", false, "Lists tasks with or without a description.")
41+
rootCmd.PersistentFlags().Bool("nested", false, "Nest namespaces when listing tasks as JSON")
42+
rootCmd.PersistentFlags().Bool("no-status", false, "Ignore status when listing tasks as JSON")
43+
rootCmd.PersistentFlags().StringP("output", "o", "", "Sets output style: [interleaved|group|prefixed].")
44+
rootCmd.PersistentFlags().String("output-group-begin", "", "Message template to print before a task's grouped output.")
45+
rootCmd.PersistentFlags().String("output-group-end", "", "Message template to print after a task's grouped output.")
46+
rootCmd.PersistentFlags().Bool("output-group-error-only", false, "Swallow output from successful tasks.")
47+
rootCmd.PersistentFlags().BoolP("parallel", "p", false, "Executes tasks provided on command line in parallel.")
48+
rootCmd.PersistentFlags().BoolP("silent", "s", false, "Disables echoing.")
49+
rootCmd.PersistentFlags().String("sort", "", "Changes the order of the tasks when listed. [default|alphanumeric|none].")
50+
rootCmd.PersistentFlags().Bool("status", false, "Exits with non-zero exit code if any of the given tasks is not up-to-date.")
51+
rootCmd.PersistentFlags().Bool("summary", false, "Show summary about a task.")
52+
rootCmd.PersistentFlags().StringP("taskfile", "t", "", "Choose which Taskfile to run. Defaults to \"Taskfile.yml\".")
53+
rootCmd.PersistentFlags().BoolP("verbose", "v", false, "Enables verbose mode.")
54+
rootCmd.PersistentFlags().Bool("version", false, "Show Task version.")
55+
rootCmd.PersistentFlags().BoolP("watch", "w", false, "Enables watch of the given task.")
56+
rootCmd.PersistentFlags().BoolP("yes", "y", false, "Assume \"yes\" as answer to all prompts.")
5457

5558
carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{
5659
"completion": carapace.ActionValues("bash", "zsh", "fish", "powershell"),

0 commit comments

Comments
 (0)