Skip to content

Commit

Permalink
gum: updates from v0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Mar 27, 2023
1 parent 0a92b3c commit 0571047
Show file tree
Hide file tree
Showing 12 changed files with 306 additions and 0 deletions.
24 changes: 24 additions & 0 deletions completers/gum_completer/cmd/choose.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var chooseCmd = &cobra.Command{

func init() {
carapace.Gen(chooseCmd).Standalone()

chooseCmd.Flags().String("cursor", "", "Prefix to show on item that corresponds to the cursor position")
chooseCmd.Flags().String("cursor-prefix", "", "Prefix to show on the cursor item (hidden if limit is 1)")
chooseCmd.Flags().String("cursor.align", "", "Text Alignment")
Expand All @@ -31,6 +32,22 @@ func init() {
chooseCmd.Flags().Bool("cursor.strikethrough", false, "Strikethrough text")
chooseCmd.Flags().Bool("cursor.underline", false, "Underline text")
chooseCmd.Flags().String("cursor.width", "", "Text width")
chooseCmd.Flags().String("header", "", "Header value")
chooseCmd.Flags().String("header.align", "", "Text Alignment")
chooseCmd.Flags().String("header.background", "", "Background Color")
chooseCmd.Flags().Bool("header.bold", false, "Bold text")
chooseCmd.Flags().String("header.border", "", "Border Style")
chooseCmd.Flags().String("header.border-background", "", "Border Background Color")
chooseCmd.Flags().String("header.border-foreground", "", "Border Foreground Color")
chooseCmd.Flags().Bool("header.faint", false, "Faint text")
chooseCmd.Flags().String("header.foreground", "", "Foreground Color")
chooseCmd.Flags().String("header.height", "", "Text height")
chooseCmd.Flags().Bool("header.italic", false, "Italicize text")
chooseCmd.Flags().String("header.margin", "", "Text margin")
chooseCmd.Flags().String("header.padding", "", "Text padding")
chooseCmd.Flags().Bool("header.strikethrough", false, "Strikethrough text")
chooseCmd.Flags().Bool("header.underline", false, "Underline text")
chooseCmd.Flags().String("header.width", "", "Text width")
chooseCmd.Flags().String("height", "", "Height of the list")
chooseCmd.Flags().String("item.align", "", "Text Alignment")
chooseCmd.Flags().String("item.background", "", "Background Color")
Expand All @@ -49,6 +66,7 @@ func init() {
chooseCmd.Flags().String("item.width", "", "Text width")
chooseCmd.Flags().String("limit", "", "Maximum number of options to pick")
chooseCmd.Flags().Bool("no-limit", false, "Pick unlimited number of options (ignores limit)")
chooseCmd.Flags().Bool("ordered", false, "Maintain the order of the selected options")
chooseCmd.Flags().StringSlice("selected", []string{}, "Options that should start as selected")
chooseCmd.Flags().String("selected-prefix", "", "Prefix to show on selected items (hidden if limit is 1)")
chooseCmd.Flags().String("selected.align", "", "Text Alignment")
Expand Down Expand Up @@ -76,6 +94,12 @@ func init() {
"cursor.border-background": gum.ActionColors(),
"cursor.border-foreground": gum.ActionColors(),
"cursor.foreground": gum.ActionColors(),
"header.align": gum.ActionAlignments(),
"header.background": gum.ActionColors(),
"header.border": gum.ActionBorders(),
"header.border-background": gum.ActionColors(),
"header.border-foreground": gum.ActionColors(),
"header.foreground": gum.ActionColors(),
"item.align": gum.ActionAlignments(),
"item.background": gum.ActionColors(),
"item.border": gum.ActionBorders(),
Expand Down
1 change: 1 addition & 0 deletions completers/gum_completer/cmd/confirm.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var confirmCmd = &cobra.Command{

func init() {
carapace.Gen(confirmCmd).Standalone()

confirmCmd.Flags().String("affirmative", "", "The title of the affirmative action")
confirmCmd.Flags().Bool("default", false, "Default confirmation action")
confirmCmd.Flags().String("negative", "", "The title of the negative action")
Expand Down
1 change: 1 addition & 0 deletions completers/gum_completer/cmd/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var fileCmd = &cobra.Command{

func init() {
carapace.Gen(fileCmd).Standalone()

fileCmd.Flags().BoolP("all", "a", false, "Show hidden and 'dot' files")
fileCmd.Flags().StringP("cursor", "c", "", "The cursor character")
fileCmd.Flags().String("cursor.align", "", "Text Alignment")
Expand Down
23 changes: 23 additions & 0 deletions completers/gum_completer/cmd/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,24 @@ var filterCmd = &cobra.Command{

func init() {
carapace.Gen(filterCmd).Standalone()

filterCmd.Flags().Bool("fuzzy", false, "Enable fuzzy matching")
filterCmd.Flags().String("header", "", "Header value")
filterCmd.Flags().String("header.align", "", "Text Alignment")
filterCmd.Flags().String("header.background", "", "Background Color")
filterCmd.Flags().Bool("header.bold", false, "Bold text")
filterCmd.Flags().String("header.border", "", "Border Style")
filterCmd.Flags().String("header.border-background", "", "Border Background Color")
filterCmd.Flags().String("header.border-foreground", "", "Border Foreground Color")
filterCmd.Flags().Bool("header.faint", false, "Faint text")
filterCmd.Flags().String("header.foreground", "", "Foreground Color")
filterCmd.Flags().String("header.height", "", "Text height")
filterCmd.Flags().Bool("header.italic", false, "Italicize text")
filterCmd.Flags().String("header.margin", "", "Text margin")
filterCmd.Flags().String("header.padding", "", "Text padding")
filterCmd.Flags().Bool("header.strikethrough", false, "Strikethrough text")
filterCmd.Flags().Bool("header.underline", false, "Underline text")
filterCmd.Flags().String("header.width", "", "Text width")
filterCmd.Flags().String("height", "", "Input height")
filterCmd.Flags().String("indicator", "", "Character for selection")
filterCmd.Flags().String("indicator.align", "", "Text Alignment")
Expand Down Expand Up @@ -120,6 +137,12 @@ func init() {
rootCmd.AddCommand(filterCmd)

carapace.Gen(filterCmd).FlagCompletion(carapace.ActionMap{
"header.align": gum.ActionAlignments(),
"header.background": gum.ActionColors(),
"header.border": gum.ActionBorders(),
"header.border-background": gum.ActionColors(),
"header.border-foreground": gum.ActionColors(),
"header.foreground": gum.ActionColors(),
"indicator.align": gum.ActionAlignments(),
"indicator.background": gum.ActionColors(),
"indicator.border": gum.ActionBorders(),
Expand Down
4 changes: 4 additions & 0 deletions completers/gum_completer/cmd/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"strings"

"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/pkg/actions/tools/chroma"
"github.com/rsteube/carapace-bin/pkg/actions/tools/gh"
"github.com/spf13/cobra"
)
Expand All @@ -16,11 +17,14 @@ var formatCmd = &cobra.Command{

func init() {
carapace.Gen(formatCmd).Standalone()

formatCmd.Flags().StringP("language", "l", "", "Programming language to parse code")
formatCmd.Flags().String("theme", "", "Glamour theme to use for markdown formatting")
formatCmd.Flags().StringP("type", "t", "", "Format to use (markdown,template,code,emoji)")
rootCmd.AddCommand(formatCmd)

carapace.Gen(formatCmd).FlagCompletion(carapace.ActionMap{
"language": chroma.ActionLexers(),
"theme": carapace.Batch(
carapace.ActionValues("ascii", "dark", "dracula", "light", "notty", "pink").Tag("themes"),
carapace.ActionFiles(),
Expand Down
1 change: 1 addition & 0 deletions completers/gum_completer/cmd/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var inputCmd = &cobra.Command{

func init() {
carapace.Gen(inputCmd).Standalone()

inputCmd.Flags().String("char-limit", "", "Maximum value length (0 for no limit)")
inputCmd.Flags().String("cursor.align", "", "Text Alignment")
inputCmd.Flags().String("cursor.background", "", "Background Color")
Expand Down
1 change: 1 addition & 0 deletions completers/gum_completer/cmd/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var joinCmd = &cobra.Command{

func init() {
carapace.Gen(joinCmd).Standalone()

joinCmd.Flags().String("align", "", "Text alignment")
joinCmd.Flags().Bool("horizontal", false, "Join (potentially multi-line) strings horizontally")
joinCmd.Flags().Bool("vertical", false, "Join (potentially multi-line) strings vertically")
Expand Down
1 change: 1 addition & 0 deletions completers/gum_completer/cmd/pager.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var pagerCmd = &cobra.Command{

func init() {
carapace.Gen(pagerCmd).Standalone()

pagerCmd.Flags().String("align", "", "Text Alignment")
pagerCmd.Flags().String("background", "", "Background Color")
pagerCmd.Flags().Bool("bold", false, "Bold text")
Expand Down
1 change: 1 addition & 0 deletions completers/gum_completer/cmd/style.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var styleCmd = &cobra.Command{

func init() {
carapace.Gen(styleCmd).Standalone()

styleCmd.Flags().String("align", "", "Text Alignment")
styleCmd.Flags().String("background", "", "Background Color")
styleCmd.Flags().Bool("bold", false, "Bold text")
Expand Down
1 change: 1 addition & 0 deletions completers/gum_completer/cmd/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var tableCmd = &cobra.Command{

func init() {
carapace.Gen(tableCmd).Standalone()

tableCmd.Flags().String("cell.align", "", "Text Alignment")
tableCmd.Flags().String("cell.background", "", "Background Color")
tableCmd.Flags().Bool("cell.bold", false, "Bold text")
Expand Down
1 change: 1 addition & 0 deletions completers/gum_completer/cmd/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var writeCmd = &cobra.Command{

func init() {
carapace.Gen(writeCmd).Standalone()

writeCmd.Flags().String("base.align", "", "Text Alignment")
writeCmd.Flags().String("base.background", "", "Background Color")
writeCmd.Flags().Bool("base.bold", false, "Bold text")
Expand Down
Loading

0 comments on commit 0571047

Please sign in to comment.