bluetoothctl: added styles (#2315)

This commit is contained in:
Ralf Steube 2024-03-29 11:09:28 +01:00 committed by GitHub
parent e35326c3ff
commit 7b50a8f545
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 22 additions and 5 deletions

View File

@ -2,6 +2,7 @@ package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace/pkg/style"
"github.com/spf13/cobra"
)
@ -15,6 +16,6 @@ func init() {
carapace.Gen(advertiseCmd).Standalone()
rootCmd.AddCommand(advertiseCmd)
carapace.Gen(advertiseCmd).PositionalCompletion(
carapace.ActionValues("on", "off", "broadcast", "peripheral"),
carapace.ActionValues("on", "off", "broadcast", "peripheral").StyleF(style.ForKeyword),
)
}

View File

@ -2,6 +2,7 @@ package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace/pkg/style"
"github.com/spf13/cobra"
)
@ -14,5 +15,8 @@ var discoverableCmd = &cobra.Command{
func init() {
carapace.Gen(discoverableCmd).Standalone()
rootCmd.AddCommand(discoverableCmd)
carapace.Gen(discoverableCmd).PositionalCompletion(carapace.ActionValues("on", "off"))
carapace.Gen(discoverableCmd).PositionalCompletion(
carapace.ActionValues("on", "off").StyleF(style.ForKeyword),
)
}

View File

@ -2,6 +2,7 @@ package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace/pkg/style"
"github.com/spf13/cobra"
)
@ -14,5 +15,8 @@ var pairableCmd = &cobra.Command{
func init() {
carapace.Gen(pairableCmd).Standalone()
rootCmd.AddCommand(pairableCmd)
carapace.Gen(pairableCmd).PositionalCompletion(carapace.ActionValues("on", "off"))
carapace.Gen(pairableCmd).PositionalCompletion(
carapace.ActionValues("on", "off").StyleF(style.ForKeyword),
)
}

View File

@ -2,6 +2,7 @@ package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace/pkg/style"
"github.com/spf13/cobra"
)
@ -14,5 +15,8 @@ var powerCmd = &cobra.Command{
func init() {
carapace.Gen(powerCmd).Standalone()
rootCmd.AddCommand(powerCmd)
carapace.Gen(powerCmd).PositionalCompletion(carapace.ActionValues("on", "off"))
carapace.Gen(powerCmd).PositionalCompletion(
carapace.ActionValues("on", "off").StyleF(style.ForKeyword),
)
}

View File

@ -2,6 +2,7 @@ package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace/pkg/style"
"github.com/spf13/cobra"
)
@ -14,5 +15,8 @@ var scanCmd = &cobra.Command{
func init() {
carapace.Gen(scanCmd).Standalone()
rootCmd.AddCommand(scanCmd)
carapace.Gen(scanCmd).PositionalCompletion(carapace.ActionValues("on", "off", "bredr", "le"))
carapace.Gen(scanCmd).PositionalCompletion(
carapace.ActionValues("on", "off", "bredr", "le").StyleF(style.ForKeyword),
)
}