hyprman/cmd/root.go

43 lines
817 B
Go
Raw Normal View History

2024-05-21 15:41:20 -05:00
package cmd
import (
"os"
2024-05-31 14:59:23 -05:00
2024-05-21 15:41:20 -05:00
cc "github.com/ivanpirog/coloredcobra"
"github.com/spf13/cobra"
2024-06-11 11:53:13 -05:00
hyprman "git.dayl.in/daylin/hyprman/internal"
2024-05-21 15:41:20 -05:00
)
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)
}
}
2024-05-31 14:59:23 -05:00
var (
configPath string
hm = &hyprman.Hyprman{}
)
2024-05-21 15:41:20 -05:00
var rootCmd = &cobra.Command{
Use: "hyprman",
Short: "hyprland companion app",
}
func init() {
2024-05-31 14:59:23 -05:00
rootCmd.CompletionOptions.HiddenDefaultCmd = true
rootCmd.PersistentFlags().StringVarP(&configPath, "config", "c", hyprman.DefaultConfigPath(), "path to config file")
2024-05-21 15:41:20 -05:00
}