From 7238174d55dab24bbf7fd36deffdb61914020663 Mon Sep 17 00:00:00 2001 From: Ralf Steube Date: Fri, 19 Jul 2024 23:59:15 +0200 Subject: [PATCH] glow: updated styles (#2430) --- completers/glow_completer/cmd/root.go | 3 ++- pkg/actions/tools/glow/style.go | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 pkg/actions/tools/glow/style.go diff --git a/completers/glow_completer/cmd/root.go b/completers/glow_completer/cmd/root.go index 3dc3222fd3..ccd0dd5951 100644 --- a/completers/glow_completer/cmd/root.go +++ b/completers/glow_completer/cmd/root.go @@ -5,6 +5,7 @@ import ( "github.com/carapace-sh/carapace" "github.com/carapace-sh/carapace-bin/pkg/actions/tools/git" + "github.com/carapace-sh/carapace-bin/pkg/actions/tools/glow" "github.com/spf13/cobra" ) @@ -34,7 +35,7 @@ func init() { carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{ "config": carapace.ActionFiles(".yml", ".yaml"), "style": carapace.Batch( - carapace.ActionValues("dark", "light", "auto"), + glow.ActionStyles(), carapace.ActionFiles(".json"), ).ToA(), }) diff --git a/pkg/actions/tools/glow/style.go b/pkg/actions/tools/glow/style.go new file mode 100644 index 0000000000..90987d44e2 --- /dev/null +++ b/pkg/actions/tools/glow/style.go @@ -0,0 +1,16 @@ +package glow + +import "github.com/carapace-sh/carapace" + +// ActionStyles completes styles +func ActionStyles() carapace.Action { + return carapace.ActionValues( + "ascii", + "auto", + "dark", + "dracula", + "light", + "notty", + "pink", + ).Tag("styles") +}