2021-05-24 00:11:58 +03:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
|
|
|
// BaseCommand provides common fields to all commands.
|
|
|
|
type BaseCommand struct {
|
2021-05-24 00:11:58 +03:00
|
|
|
Stdin io.Reader
|
|
|
|
Stdout io.Writer
|
|
|
|
Stderr io.Writer
|
2021-05-24 00:11:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Init initializes BaseCommand with default arguments
|
|
|
|
func (b *BaseCommand) Init() {
|
|
|
|
b.Stdin = os.Stdin
|
|
|
|
b.Stdout = os.Stdout
|
|
|
|
b.Stderr = os.Stderr
|
|
|
|
}
|