package ncmd import ( "git.noahlan.cn/noahlan/ntool/ndef" ) func WithOptions(o *Options) Option { return func(opt *Options) { opt.Marshaler = o.Marshaler opt.DevMode = o.DevMode opt.Buffered = o.Buffered opt.Streaming = o.Streaming opt.LineBufferSize = o.LineBufferSize opt.CombinedOutput = o.CombinedOutput } } func WithMarshaler(marshaler ndef.Marshaler) Option { return func(opt *Options) { opt.Marshaler = marshaler } } func WithBuffered(v bool) Option { return func(opt *Options) { opt.Buffered = v } } func WithCombinedOutput() Option { return func(opt *Options) { opt.CombinedOutput = true } } func WithStreaming() Option { return func(opt *Options) { opt.Streaming = true } } func WithLineBufferSize(size uint) Option { return func(opt *Options) { opt.LineBufferSize = size } } func WithDevMode(val bool) Option { return func(opt *Options) { opt.DevMode = val } }