Skip to content

Commit 9445213

Browse files
committed
info cmd
1 parent f594530 commit 9445213

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

backend/doi/doi.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,8 @@ func (f *Fs) Command(ctx context.Context, name string, arg []string, opt map[str
596596
return f.ShowTitle(ctx)
597597
case "provider":
598598
return string(f.provider), nil
599+
case "info":
600+
return f.ShowInfo(ctx)
599601
case "set":
600602
newOpt := f.opt
601603
err := configstruct.Set(configmap.Simple(opt), &newOpt)
@@ -663,6 +665,14 @@ func (f *Fs) ShowTitle(ctx context.Context) (title string, err error) {
663665
return "<unknown title>", nil
664666
}
665667

668+
func (f *Fs) ShowInfo(ctx context.Context) (metadata interface{}, err error) {
669+
info := map[string]any{}
670+
info["DOI"] = f.opt.Doi
671+
info["metadataURL"] = f.endpointURL
672+
info["provider"] = f.provider
673+
return info, nil
674+
}
675+
666676
// Check the interfaces are satisfied
667677
var (
668678
_ fs.Fs = (*Fs)(nil)

0 commit comments

Comments
 (0)