2022-11-16 04:48:46PM

This commit is contained in:
Alexander Wang 2022-11-16 16:48:46 -08:00
parent e1846b0e4a
commit 359a12b5f8
No known key found for this signature in database
GPG key ID: D89FA31966BDBECE

View file

@ -19,12 +19,12 @@ import (
// Also see execPlugin in exec.go for the d2 binary plugin protocol.
func Serve(p Plugin) func(context.Context, *xmain.State) error {
return func(ctx context.Context, ms *xmain.State) (err error) {
if len(ms.Opts.Args()) < 1 {
if len(ms.Opts.Flags.Args()) < 1 {
return errors.New("expected first argument to plugin binary to be function name")
}
reqFunc := ms.Opts.Arg(0)
reqFunc := ms.Opts.Flags.Arg(0)
switch ms.Opts.Arg(0) {
switch ms.Opts.Flags.Arg(0) {
case "info":
return info(ctx, p, ms)
case "layout":