From 5984d83a464714a12bf0016769bae4af292c8fb8 Mon Sep 17 00:00:00 2001 From: daniel fusser Date: Mon, 10 Apr 2023 21:42:05 +0200 Subject: [PATCH] add support for drag and drop on windows to inline dropped html files --- cmd/root.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index 67eedaa..36fa954 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -22,8 +22,14 @@ type Config struct { var rootCmd = &cobra.Command{ Use: "gomailer", Short: "use it to test email templates", + Args: cobra.MinimumNArgs(1), Long: ``, - // Run: func(cmd *cobra.Command, args []string) { }, + Run: func(cmd *cobra.Command, args []string) { + log.Printf("Templates: %v", args) + for _, arg := range args { + gomailer.Inline(arg) + } + }, } // Execute adds all child commands to the root command and sets flags appropriately. @@ -36,6 +42,7 @@ func Execute() { } func init() { + cobra.MousetrapHelpText = "" // disable warning on windows for drag n drop to exe cobra.OnInitialize(initConfig) rootCmd.CompletionOptions.DisableDefaultCmd = true rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.gomailer.yaml)")