func (nepcalCli) convBSToAD(c *cli.Context) error {
	if !validateArgs(c) {
		fmt.Fprintln(os.Stderr, "Please supply a valid date in the format mm-dd-yyyy. Example: `nepcal conv toad 08-18-2053`")
		return cli.NewExitError("", 1)
	}
	mm, dd, yy, _ := parseRawDate(c.Args().First())
	d, err := nepcal.Date(yy, nepcal.Month(mm), dd)
	if err != nil {
		fmt.Fprintln(os.Stderr, "Please ensure the date is between 1/1/2000 and 12/30/2095")
		return cli.NewExitError("", 1)
	}
	printGregorian(globalWriter, d.Gregorian())
	return nil
}
Convert BS date to AD date after validation.
package main
import (
	"fmt"
	"io"
	"os"
	"strconv"
	"strings"
	"time"
	"github.com/srishanbhattarai/nepcal/nepcal"
	"github.com/urfave/cli/v2"
)
type nepcalCli struct{}
func (nepcalCli) showCalendar(c *cli.Context) error {
	calReader := nepcal.CalendarNow()
	io.Copy(globalWriter, calReader)
	return nil
}
func (nepcalCli) showDate(w io.Writer, t time.Time) func(c *cli.Context) error {
	return func(c *cli.Context) error {
		bs := nepcal.FromGregorianUnchecked(t)
		fmt.Fprintln(w, bs.String())
		return nil
	}
}
func (nepcalCli) convADToBS(c *cli.Context) error {
	if !validateArgs(c) {
		fmt.Fprintln(os.Stderr, "Please supply a valid date in the format mm-dd-yyyy. Example: `nepcal conv tobs 08-21-1994`")
		return cli.NewExitError("", 1)
	}
	mm, dd, yy, _ := parseRawDate(c.Args().First())
	ad := gregorian(yy, mm, dd)
	bs, err := nepcal.FromGregorian(ad)
	if err != nil {
		fmt.Fprintln(os.Stderr, "Please supply a date after 04/14/1943.")
		return cli.NewExitError("", 1)
	}
	fmt.Fprintln(globalWriter, bs.String())
	return nil
}