Skip to content

Commit

Permalink
gum: updates from v0.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Apr 27, 2024
1 parent b99011b commit 24a8ba1
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 19 deletions.
21 changes: 21 additions & 0 deletions completers/gum_completer/cmd/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,21 @@ func init() {
filterCmd.Flags().String("match.width", "", "Text width")
filterCmd.Flags().Bool("no-limit", false, "Pick unlimited number of options (ignores limit)")
filterCmd.Flags().String("placeholder", "", "Placeholder value")
filterCmd.Flags().String("placeholder.align", "", "Text Alignment")
filterCmd.Flags().String("placeholder.background", "", "Background Color")
filterCmd.Flags().Bool("placeholder.bold", false, "Bold text")
filterCmd.Flags().String("placeholder.border", "", "Border Style")
filterCmd.Flags().String("placeholder.border-background", "", "Border Background Color")
filterCmd.Flags().String("placeholder.border-foreground", "", "Border Foreground Color")
filterCmd.Flags().Bool("placeholder.faint", false, "Faint text")
filterCmd.Flags().String("placeholder.foreground", "", "Foreground Color")
filterCmd.Flags().String("placeholder.height", "", "Text height")
filterCmd.Flags().Bool("placeholder.italic", false, "Italicize text")
filterCmd.Flags().String("placeholder.margin", "", "Text margin")
filterCmd.Flags().String("placeholder.padding", "", "Text padding")
filterCmd.Flags().Bool("placeholder.strikethrough", false, "Strikethrough text")
filterCmd.Flags().Bool("placeholder.underline", false, "Underline text")
filterCmd.Flags().String("placeholder.width", "", "Text width")
filterCmd.Flags().String("prompt", "", "Prompt to display")
filterCmd.Flags().String("prompt.align", "", "Text Alignment")
filterCmd.Flags().String("prompt.background", "", "Background Color")
Expand Down Expand Up @@ -179,6 +194,12 @@ func init() {
"match.border-background": gum.ActionColors(),
"match.border-foreground": gum.ActionColors(),
"match.foreground": gum.ActionColors(),
"placeholder.align": gum.ActionAlignments(),
"placeholder.background": gum.ActionColors(),
"placeholder.border": gum.ActionBorders(),
"placeholder.border-background": gum.ActionColors(),
"placeholder.border-foreground": gum.ActionColors(),
"placeholder.foreground": gum.ActionColors(),
"prompt.align": gum.ActionAlignments(),
"prompt.background": gum.ActionColors(),
"prompt.border": gum.ActionBorders(),
Expand Down
59 changes: 40 additions & 19 deletions completers/gum_completer/cmd/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,21 @@ func init() {
inputCmd.Flags().String("header.width", "", "Text width")
inputCmd.Flags().Bool("password", false, "Mask input characters")
inputCmd.Flags().String("placeholder", "", "Placeholder value")
inputCmd.Flags().String("placeholder.align", "", "Text Alignment")
inputCmd.Flags().String("placeholder.background", "", "Background Color")
inputCmd.Flags().Bool("placeholder.bold", false, "Bold text")
inputCmd.Flags().String("placeholder.border", "", "Border Style")
inputCmd.Flags().String("placeholder.border-background", "", "Border Background Color")
inputCmd.Flags().String("placeholder.border-foreground", "", "Border Foreground Color")
inputCmd.Flags().Bool("placeholder.faint", false, "Faint text")
inputCmd.Flags().String("placeholder.foreground", "", "Foreground Color")
inputCmd.Flags().String("placeholder.height", "", "Text height")
inputCmd.Flags().Bool("placeholder.italic", false, "Italicize text")
inputCmd.Flags().String("placeholder.margin", "", "Text margin")
inputCmd.Flags().String("placeholder.padding", "", "Text padding")
inputCmd.Flags().Bool("placeholder.strikethrough", false, "Strikethrough text")
inputCmd.Flags().Bool("placeholder.underline", false, "Underline text")
inputCmd.Flags().String("placeholder.width", "", "Text width")
inputCmd.Flags().String("prompt", "", "Prompt to display")
inputCmd.Flags().String("prompt.align", "", "Text Alignment")
inputCmd.Flags().String("prompt.background", "", "Background Color")
Expand All @@ -72,24 +87,30 @@ func init() {
rootCmd.AddCommand(inputCmd)

carapace.Gen(inputCmd).FlagCompletion(carapace.ActionMap{
"cursor.align": gum.ActionAlignments(),
"cursor.background": gum.ActionColors(),
"cursor.border": gum.ActionBorders(),
"cursor.border-background": gum.ActionColors(),
"cursor.border-foreground": gum.ActionColors(),
"cursor.foreground": gum.ActionColors(),
"cursor.mode": gum.ActionCursorModes(),
"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(),
"prompt.align": gum.ActionAlignments(),
"prompt.background": gum.ActionColors(),
"prompt.border": gum.ActionBorders(),
"prompt.border-background": gum.ActionColors(),
"prompt.border-foreground": gum.ActionColors(),
"prompt.foreground": gum.ActionColors(),
"cursor.align": gum.ActionAlignments(),
"cursor.background": gum.ActionColors(),
"cursor.border": gum.ActionBorders(),
"cursor.border-background": gum.ActionColors(),
"cursor.border-foreground": gum.ActionColors(),
"cursor.foreground": gum.ActionColors(),
"cursor.mode": gum.ActionCursorModes(),
"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(),
"placeholder.align": gum.ActionAlignments(),
"placeholder.background": gum.ActionColors(),
"placeholder.border": gum.ActionBorders(),
"placeholder.border-background": gum.ActionColors(),
"placeholder.border-foreground": gum.ActionColors(),
"placeholder.foreground": gum.ActionColors(),
"prompt.align": gum.ActionAlignments(),
"prompt.background": gum.ActionColors(),
"prompt.border": gum.ActionBorders(),
"prompt.border-background": gum.ActionColors(),
"prompt.border-foreground": gum.ActionColors(),
"prompt.foreground": gum.ActionColors(),
})
}
1 change: 1 addition & 0 deletions completers/gum_completer/cmd/spin.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func init() {
spinCmd.Flags().SetInterspersed(false)

spinCmd.Flags().StringP("align", "a", "", "Alignment of spinner with regard to the title")
spinCmd.Flags().Bool("show-error", false, "Show output of command only if the command fails")
spinCmd.Flags().Bool("show-output", false, "Show or pipe output of command during execution")
spinCmd.Flags().StringP("spinner", "s", "", "Spinner type")
spinCmd.Flags().String("spinner.align", "", "Text Alignment")
Expand Down

0 comments on commit 24a8ba1

Please sign in to comment.