package cmd import ( "termshare/internal/daemon" "github.com/spf13/cobra" ) var ( flagPort string ) func init() { cmd := &cobra.Command{ Use: "daemon", Short: "Run the daemon command", Long: "run the daemon command", Run: func(cmd *cobra.Command, args []string) { daemon.RunDaemon(flagPort) }, } cmd.PersistentFlags().StringVarP(&flagPort, "port", "", "8080", "The port the daemon should listen to") rootCmd.AddCommand(cmd) }