add support for drag and drop on windows to inline dropped html files
This commit is contained in:
parent
c158f4ee54
commit
5984d83a46
@ -22,8 +22,14 @@ type Config struct {
|
|||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
Use: "gomailer",
|
Use: "gomailer",
|
||||||
Short: "use it to test email templates",
|
Short: "use it to test email templates",
|
||||||
|
Args: cobra.MinimumNArgs(1),
|
||||||
Long: ``,
|
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.
|
// Execute adds all child commands to the root command and sets flags appropriately.
|
||||||
@ -36,6 +42,7 @@ func Execute() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
cobra.MousetrapHelpText = "" // disable warning on windows for drag n drop to exe
|
||||||
cobra.OnInitialize(initConfig)
|
cobra.OnInitialize(initConfig)
|
||||||
rootCmd.CompletionOptions.DisableDefaultCmd = true
|
rootCmd.CompletionOptions.DisableDefaultCmd = true
|
||||||
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.gomailer.yaml)")
|
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.gomailer.yaml)")
|
||||||
|
Loading…
Reference in New Issue
Block a user