28 lines
410 B
Go
28 lines
410 B
Go
|
package enc
|
||
|
|
||
|
import "surdeus.su/core/cli/mtool"
|
||
|
import "io"
|
||
|
import "os"
|
||
|
|
||
|
type EncodeOptions struct {
|
||
|
}
|
||
|
|
||
|
func NewEncodeTool(
|
||
|
name string,
|
||
|
encFn func (io.Writer) io.Writer,
|
||
|
) *mtool.Tool {
|
||
|
ret := mtool.T(name).Func(func(flags *mtool.Flags){
|
||
|
//var opts EncodeOptions
|
||
|
_ = flags.Parse()
|
||
|
|
||
|
input := os.Stdin
|
||
|
output := os.Stdout
|
||
|
|
||
|
encOutput := encFn(output)
|
||
|
io.Copy(encOutput, input)
|
||
|
})
|
||
|
|
||
|
return ret
|
||
|
}
|
||
|
|