hyprman/cmd/root.go

43 lines
817 B
Go

package cmd
import (
"os"
cc "github.com/ivanpirog/coloredcobra"
"github.com/spf13/cobra"
hyprman "git.dayl.in/daylin/hyprman/internal"
)
func Execute() {
cc.Init(&cc.Config{
RootCmd: rootCmd,
Headings: cc.HiMagenta + cc.Bold,
Commands: cc.Bold,
Example: cc.Italic,
ExecName: cc.Bold,
Flags: cc.Bold,
NoExtraNewlines: true,
NoBottomNewline: true,
})
err := rootCmd.Execute()
if err != nil {
os.Exit(1)
}
}
var (
configPath string
hm = &hyprman.Hyprman{}
)
var rootCmd = &cobra.Command{
Use: "hyprman",
Short: "hyprland companion app",
}
func init() {
rootCmd.CompletionOptions.HiddenDefaultCmd = true
rootCmd.PersistentFlags().StringVarP(&configPath, "config", "c", hyprman.DefaultConfigPath(), "path to config file")
}