package main

import (
	"errors"
	"log"

	"github.com/mattn/go-mastodon"
	"github.com/urfave/cli"
)

func cmdToot(c *cli.Context) error {
	var toot string
	ff := c.String("ff")
	if ff != "" {
		text, err := readFile(ff)
		if err != nil {
			log.Fatal(err)
		}
		toot = string(text)
	} else {
		if !c.Args().Present() {
			return errors.New("arguments required")
		}
		toot = argstr(c)
	}
	client := c.App.Metadata["client"].(*mastodon.Client)
	_, err := client.PostStatus(&mastodon.Toot{
		Status: toot,
	})
	return err
}

package main

import (
	"errors"
	"log"

	"github.com/mattn/go-mastodon"
	"github.com/urfave/cli"
)

func cmdToot(c *cli.Context) error {
	if !c.Args().Present() {
		return errors.New("arguments required")
	}

	var toot string
	ff := c.String("ff")
	if ff != "" {
		text, err := readFile(ff)
		if err != nil {
			log.Fatal(err)
		}
		toot = string(text)
	} else {
		toot = argstr(c)
	}
	client := c.App.Metadata["client"].(*mastodon.Client)
	_, err := client.PostStatus(&mastodon.Toot{
		Status: toot,
	})
	return err
}

--- 
+++ 
@@ -9,10 +9,6 @@
 )
 
 func cmdToot(c *cli.Context) error {
-	if !c.Args().Present() {
-		return errors.New("arguments required")
-	}
-
 	var toot string
 	ff := c.String("ff")
 	if ff != "" {
@@ -22,6 +18,9 @@
 		}
 		toot = string(text)
 	} else {
+		if !c.Args().Present() {
+			return errors.New("arguments required")
+		}
 		toot = argstr(c)
 	}
 	client := c.App.Metadata["client"].(*mastodon.Client)
Fix `mstdn.exe toot -ff -` errors `arguments required`
