cmd

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Copyright © 2023-2024 Jens Hilligsøe

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

This section is empty.

Variables

View Source
var ConfigCmd = &cobra.Command{
	Use:   "config",
	Short: "Configure kefw2",
	Long: `kefw2 needs to be configured with the IP address of your W2 speaker.
	This will do it.`,
	Run: func(cmd *cobra.Command, args []string) {
		cmd.Help()
	},
}

configCmd represents the config command

View Source
var VersionCmd = &cobra.Command{
	Use:  "version",
	Long: "Print the version number of kefw2",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("kefw2: Command line tool for controlling KEF's W2 platform speakers")
		if info, ok := debug.ReadBuildInfo(); ok {
			for _, v := range info.Settings {
				switch v.Key {
				case "vcs.revision":
					fmt.Printf("Version: %s\n", v.Value)
				case "vcs.time":
					fmt.Printf("Build date: %s\n", v.Value)
				}
			}
		}
	},
}

Functions

func ConfiguredSpeakersCompletion

func ConfiguredSpeakersCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func MuteCompletion

func MuteCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

func SourceCompletion

func SourceCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

func VolumeCompletion

func VolumeCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL