diff --git a/completers/bluetoothctl_completer/cmd/action/action.go b/completers/bluetoothctl_completer/cmd/action/action.go new file mode 100644 index 0000000000..9ab706174e --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/action/action.go @@ -0,0 +1,62 @@ +package action + +import ( + "strings" + + "github.com/carapace-sh/carapace" +) + +func ActionAgents() carapace.Action { + return carapace.ActionValues( + "off", + "on", + "auto", + "NoInputNoOutput", + "KeyboardOnly", + "KeyboardDisplay", + "DisplayYesNo", + "DisplayOnly", + ) +} + +func ActionControllers() carapace.Action { + return carapace.ActionCallback(func(c carapace.Context) carapace.Action { + return carapace.ActionExecCommand("bluetoothctl", "list")(func(output []byte) carapace.Action { + lines := strings.Split(string(output), "\n") + vals := make([]string, 0) + + for _, line := range lines { + if line == "" { + break + } + + fields := strings.Fields(line) + vals = append(vals, fields[1], strings.Join(fields[2:], " ")) + } + return carapace.ActionValuesDescribed(vals...) + }) + }) +} + +func ActionDevices(filter string) carapace.Action { + return carapace.ActionCallback(func(c carapace.Context) carapace.Action { + args := []string{"devices"} + if filter != "" { + args = append(args, filter) + } + return carapace.ActionExecCommand("bluetoothctl", args...)(func(output []byte) carapace.Action { + lines := strings.Split(string(output), "\n") + vals := make([]string, 0) + + for _, line := range lines { + if line == "" { + break + } + + fields := strings.Fields(line) + vals = append(vals, fields[1], strings.Join(fields[2:], " ")) + } + return carapace.ActionValuesDescribed(vals...) + }) + }) +} diff --git a/completers/bluetoothctl_completer/cmd/advertise.go b/completers/bluetoothctl_completer/cmd/advertise.go new file mode 100644 index 0000000000..6fc61d4a31 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/advertise.go @@ -0,0 +1,20 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var advertiseCmd = &cobra.Command{ + Use: "advertise [on|off|broadcast|peripheral]", + Short: "Enable/disable advertising", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(advertiseCmd).Standalone() + rootCmd.AddCommand(advertiseCmd) + carapace.Gen(advertiseCmd).PositionalCompletion( + carapace.ActionValues("on", "off", "broadcast", "peripheral"), + ) +} diff --git a/completers/bluetoothctl_completer/cmd/agent.go b/completers/bluetoothctl_completer/cmd/agent.go new file mode 100644 index 0000000000..575f0b2a80 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/agent.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/bluetoothctl_completer/cmd/action" + "github.com/spf13/cobra" +) + +var agentCmd = &cobra.Command{ + Use: "agent ", + Short: "Enable/disable agent with given capability", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(agentCmd).Standalone() + rootCmd.AddCommand(agentCmd) + carapace.Gen(agentCmd).PositionalCompletion( + action.ActionAgents(), + ) +} diff --git a/completers/bluetoothctl_completer/cmd/block.go b/completers/bluetoothctl_completer/cmd/block.go new file mode 100644 index 0000000000..7491a16056 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/block.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/bluetoothctl_completer/cmd/action" + "github.com/spf13/cobra" +) + +var blockCmd = &cobra.Command{ + Use: "block ", + Short: "Block device", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(blockCmd).Standalone() + rootCmd.AddCommand(blockCmd) + carapace.Gen(blockCmd).PositionalCompletion( + action.ActionDevices(""), + ) +} diff --git a/completers/bluetoothctl_completer/cmd/cancelPairing.go b/completers/bluetoothctl_completer/cmd/cancelPairing.go new file mode 100644 index 0000000000..6f80f10b70 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/cancelPairing.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/bluetoothctl_completer/cmd/action" + "github.com/spf13/cobra" +) + +var cancelPairingCmd = &cobra.Command{ + Use: "cancel-pairing ", + Short: "Cancel pairing with device", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cancelPairingCmd).Standalone() + rootCmd.AddCommand(cancelPairingCmd) + carapace.Gen(cancelPairingCmd).PositionalCompletion( + action.ActionDevices("Paired"), + ) +} diff --git a/completers/bluetoothctl_completer/cmd/connect.go b/completers/bluetoothctl_completer/cmd/connect.go new file mode 100644 index 0000000000..70447a4de6 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/connect.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/bluetoothctl_completer/cmd/action" + "github.com/spf13/cobra" +) + +var connectCmd = &cobra.Command{ + Use: "connect ", + Short: "Connect device", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(connectCmd).Standalone() + rootCmd.AddCommand(connectCmd) + carapace.Gen(connectCmd).PositionalCompletion( + action.ActionDevices(""), + ) +} diff --git a/completers/bluetoothctl_completer/cmd/defaultAgent.go b/completers/bluetoothctl_completer/cmd/defaultAgent.go new file mode 100644 index 0000000000..137761d5d0 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/defaultAgent.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var defaultAgentCmd = &cobra.Command{ + Use: "default-agent", + Short: "Set agent as the default one", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(defaultAgentCmd).Standalone() + rootCmd.AddCommand(defaultAgentCmd) +} diff --git a/completers/bluetoothctl_completer/cmd/devices.go b/completers/bluetoothctl_completer/cmd/devices.go new file mode 100644 index 0000000000..2b86a3d20a --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/devices.go @@ -0,0 +1,20 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var devicesCmd = &cobra.Command{ + Use: "devices", + Short: "List available devices, with an optional property as the filter", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(devicesCmd).Standalone() + rootCmd.AddCommand(devicesCmd) + carapace.Gen(devicesCmd).PositionalCompletion( + carapace.ActionValues("Paired", "Bonded", "Trusted", "Connected"), + ) +} diff --git a/completers/bluetoothctl_completer/cmd/disconnect.go b/completers/bluetoothctl_completer/cmd/disconnect.go new file mode 100644 index 0000000000..a616e21702 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/disconnect.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/bluetoothctl_completer/cmd/action" + "github.com/spf13/cobra" +) + +var disconnectCmd = &cobra.Command{ + Use: "disconnect ", + Short: "Disconnect device", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(disconnectCmd).Standalone() + rootCmd.AddCommand(disconnectCmd) + carapace.Gen(disconnectCmd).PositionalCompletion( + action.ActionDevices("Connected"), + ) +} diff --git a/completers/bluetoothctl_completer/cmd/discoverable.go b/completers/bluetoothctl_completer/cmd/discoverable.go new file mode 100644 index 0000000000..79c770ecb0 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/discoverable.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var discoverableCmd = &cobra.Command{ + Use: "discoverable [on|off]", + Short: "Set controller discoverable mode", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(discoverableCmd).Standalone() + rootCmd.AddCommand(discoverableCmd) + carapace.Gen(discoverableCmd).PositionalCompletion(carapace.ActionValues("on", "off")) +} diff --git a/completers/bluetoothctl_completer/cmd/discoverableTimeout.go b/completers/bluetoothctl_completer/cmd/discoverableTimeout.go new file mode 100644 index 0000000000..b6fa7f1992 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/discoverableTimeout.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var discoverableTimeoutCmd = &cobra.Command{ + Use: "discoverable-timeout [value]", + Short: "Set controller discoverable timeout", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(discoverableTimeoutCmd).Standalone() + rootCmd.AddCommand(discoverableTimeoutCmd) +} diff --git a/completers/bluetoothctl_completer/cmd/export.go b/completers/bluetoothctl_completer/cmd/export.go new file mode 100644 index 0000000000..6fed87fc98 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/export.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var exportCmd = &cobra.Command{ + Use: "export", + Short: "Print environment variables", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(exportCmd).Standalone() + rootCmd.AddCommand(exportCmd) +} diff --git a/completers/bluetoothctl_completer/cmd/help.go b/completers/bluetoothctl_completer/cmd/help.go new file mode 100644 index 0000000000..f158229fec --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/help.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var helpCmd = &cobra.Command{ + Use: "help", + Short: "Display help about this program", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(helpCmd).Standalone() + rootCmd.AddCommand(helpCmd) +} diff --git a/completers/bluetoothctl_completer/cmd/info.go b/completers/bluetoothctl_completer/cmd/info.go new file mode 100644 index 0000000000..7f7d7f34e0 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/info.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/bluetoothctl_completer/cmd/action" + "github.com/spf13/cobra" +) + +var infoCmd = &cobra.Command{ + Use: "info [device]", + Short: "Device/Set information", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(infoCmd).Standalone() + rootCmd.AddCommand(infoCmd) + carapace.Gen(infoCmd).PositionalCompletion( + action.ActionDevices(""), + ) +} diff --git a/completers/bluetoothctl_completer/cmd/list.go b/completers/bluetoothctl_completer/cmd/list.go new file mode 100644 index 0000000000..f9cb06fbaf --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/list.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var listCmd = &cobra.Command{ + Use: "list", + Short: "List available controllers", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(listCmd).Standalone() + rootCmd.AddCommand(listCmd) +} diff --git a/completers/bluetoothctl_completer/cmd/pair.go b/completers/bluetoothctl_completer/cmd/pair.go new file mode 100644 index 0000000000..be6b027b5e --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/pair.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/bluetoothctl_completer/cmd/action" + "github.com/spf13/cobra" +) + +var pairCmd = &cobra.Command{ + Use: "pair ", + Short: "Pair with device", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(pairCmd).Standalone() + rootCmd.AddCommand(pairCmd) + carapace.Gen(pairCmd).PositionalCompletion( + action.ActionDevices(""), + ) +} diff --git a/completers/bluetoothctl_completer/cmd/pairable.go b/completers/bluetoothctl_completer/cmd/pairable.go new file mode 100644 index 0000000000..a01013fe28 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/pairable.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var pairableCmd = &cobra.Command{ + Use: "pairable [on|off]", + Short: "Set controller pairable mode", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(pairableCmd).Standalone() + rootCmd.AddCommand(pairableCmd) + carapace.Gen(pairableCmd).PositionalCompletion(carapace.ActionValues("on", "off")) +} diff --git a/completers/bluetoothctl_completer/cmd/power.go b/completers/bluetoothctl_completer/cmd/power.go new file mode 100644 index 0000000000..a2e74c658c --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/power.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var powerCmd = &cobra.Command{ + Use: "power [on|off]", + Short: "Set controller power state", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(powerCmd).Standalone() + rootCmd.AddCommand(powerCmd) + carapace.Gen(powerCmd).PositionalCompletion(carapace.ActionValues("on", "off")) +} diff --git a/completers/bluetoothctl_completer/cmd/remove.go b/completers/bluetoothctl_completer/cmd/remove.go new file mode 100644 index 0000000000..e12f4c9ef6 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/remove.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/bluetoothctl_completer/cmd/action" + "github.com/spf13/cobra" +) + +var removeCmd = &cobra.Command{ + Use: "remove ", + Short: "Remove device", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(removeCmd).Standalone() + rootCmd.AddCommand(removeCmd) + carapace.Gen(removeCmd).PositionalCompletion( + action.ActionDevices(""), + ) +} diff --git a/completers/bluetoothctl_completer/cmd/resetAlias.go b/completers/bluetoothctl_completer/cmd/resetAlias.go new file mode 100644 index 0000000000..5f280f9087 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/resetAlias.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var resetAliasCmd = &cobra.Command{ + Use: "reset-alias", + Short: "Reset controller alias", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(resetAliasCmd).Standalone() + rootCmd.AddCommand(resetAliasCmd) +} diff --git a/completers/bluetoothctl_completer/cmd/root.go b/completers/bluetoothctl_completer/cmd/root.go new file mode 100644 index 0000000000..abc625a17d --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/root.go @@ -0,0 +1,33 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/bluetoothctl_completer/cmd/action" + "github.com/spf13/cobra" +) + +var rootCmd = &cobra.Command{ + Use: "bluetoothctl", + Short: "Bluetooth Control Command Line Tool", + Long: "https://www.bluez.org/", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func Execute() error { + return rootCmd.Execute() +} + +func init() { + carapace.Gen(rootCmd).Standalone() + + rootCmd.Flags().StringP("agent", "a", "", "Register agent handler: ") + rootCmd.Flags().BoolP("endpoints", "e", false, "Register media endpoints") + rootCmd.Flags().BoolP("help", "h", false, "Display help") + rootCmd.Flags().BoolP("monitor", "m", false, "Enable monitor output") + rootCmd.Flags().StringP("timeout", "t", "", "Timeout in seconds for non-interactive mode") + rootCmd.Flags().BoolP("version", "v", false, "Display version") + + carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{ + "agent": action.ActionAgents(), + }) +} diff --git a/completers/bluetoothctl_completer/cmd/scan.go b/completers/bluetoothctl_completer/cmd/scan.go new file mode 100644 index 0000000000..b7ba39b2c3 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/scan.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var scanCmd = &cobra.Command{ + Use: "scan ", + Short: "Scan for devices", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(scanCmd).Standalone() + rootCmd.AddCommand(scanCmd) + carapace.Gen(scanCmd).PositionalCompletion(carapace.ActionValues("on", "off", "bredr", "le")) +} diff --git a/completers/bluetoothctl_completer/cmd/select.go b/completers/bluetoothctl_completer/cmd/select.go new file mode 100644 index 0000000000..c39961daa9 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/select.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/bluetoothctl_completer/cmd/action" + "github.com/spf13/cobra" +) + +var selectCmd = &cobra.Command{ + Use: "select ", + Short: "Select default controller", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(selectCmd).Standalone() + rootCmd.AddCommand(selectCmd) + carapace.Gen(selectCmd).PositionalCompletion( + action.ActionControllers(), + ) +} diff --git a/completers/bluetoothctl_completer/cmd/setAlias.go b/completers/bluetoothctl_completer/cmd/setAlias.go new file mode 100644 index 0000000000..9f7ef3e318 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/setAlias.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var setAliasCmd = &cobra.Command{ + Use: "set-alias ", + Short: "Set device alias", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(setAliasCmd).Standalone() + rootCmd.AddCommand(setAliasCmd) +} diff --git a/completers/bluetoothctl_completer/cmd/show.go b/completers/bluetoothctl_completer/cmd/show.go new file mode 100644 index 0000000000..61caa0d4e9 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/show.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/bluetoothctl_completer/cmd/action" + "github.com/spf13/cobra" +) + +var showCmd = &cobra.Command{ + Use: "show [controller]", + Short: "Show controller information", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(showCmd).Standalone() + rootCmd.AddCommand(showCmd) + carapace.Gen(showCmd).PositionalCompletion( + action.ActionControllers(), + ) +} diff --git a/completers/bluetoothctl_completer/cmd/systemAlias.go b/completers/bluetoothctl_completer/cmd/systemAlias.go new file mode 100644 index 0000000000..d5f9ab6be3 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/systemAlias.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var systemAliasCmd = &cobra.Command{ + Use: "system-alias ", + Short: "Set controller alias", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(systemAliasCmd).Standalone() + rootCmd.AddCommand(systemAliasCmd) +} diff --git a/completers/bluetoothctl_completer/cmd/trust.go b/completers/bluetoothctl_completer/cmd/trust.go new file mode 100644 index 0000000000..83219fbd43 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/trust.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/bluetoothctl_completer/cmd/action" + "github.com/spf13/cobra" +) + +var trustCmd = &cobra.Command{ + Use: "trust [device]", + Short: "Trust device", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(trustCmd).Standalone() + rootCmd.AddCommand(trustCmd) + carapace.Gen(trustCmd).PositionalCompletion( + action.ActionDevices(""), + ) +} diff --git a/completers/bluetoothctl_completer/cmd/unblock.go b/completers/bluetoothctl_completer/cmd/unblock.go new file mode 100644 index 0000000000..0f97713188 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/unblock.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/bluetoothctl_completer/cmd/action" + "github.com/spf13/cobra" +) + +var unblockCmd = &cobra.Command{ + Use: "unblock ", + Short: "Unblock device", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(unblockCmd).Standalone() + rootCmd.AddCommand(unblockCmd) + carapace.Gen(unblockCmd).PositionalCompletion( + action.ActionDevices(""), + ) +} diff --git a/completers/bluetoothctl_completer/cmd/untrust.go b/completers/bluetoothctl_completer/cmd/untrust.go new file mode 100644 index 0000000000..621e985b08 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/untrust.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/bluetoothctl_completer/cmd/action" + "github.com/spf13/cobra" +) + +var untrustCmd = &cobra.Command{ + Use: "untrust ", + Short: "Untrust device", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(untrustCmd).Standalone() + rootCmd.AddCommand(untrustCmd) + carapace.Gen(untrustCmd).PositionalCompletion( + action.ActionDevices("Trusted"), + ) +} diff --git a/completers/bluetoothctl_completer/cmd/version.go b/completers/bluetoothctl_completer/cmd/version.go new file mode 100644 index 0000000000..f314979c58 --- /dev/null +++ b/completers/bluetoothctl_completer/cmd/version.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var versionCmd = &cobra.Command{ + Use: "version", + Short: "Display version", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(versionCmd).Standalone() + rootCmd.AddCommand(versionCmd) +} diff --git a/completers/bluetoothctl_completer/main.go b/completers/bluetoothctl_completer/main.go new file mode 100644 index 0000000000..d5a19dd9d4 --- /dev/null +++ b/completers/bluetoothctl_completer/main.go @@ -0,0 +1,7 @@ +package main + +import "github.com/carapace-sh/carapace-bin/completers/bluetoothctl_completer/cmd" + +func main() { + cmd.Execute() +}