add more details
This commit is contained in:
12
cmd/root.go
12
cmd/root.go
@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
@@ -46,7 +47,16 @@ func handleEvent(event sdl.Event, m *milkDropWindow) bool {
|
||||
}
|
||||
|
||||
func milkbucket(cmd *cobra.Command, args []string) {
|
||||
err := sdl.Init(sdl.INIT_VIDEO)
|
||||
fi, err := os.Stdin.Stat()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
size := fi.Size()
|
||||
if size <= 0 {
|
||||
log.Fatal("stdin is empty")
|
||||
}
|
||||
|
||||
err = sdl.Init(sdl.INIT_VIDEO)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user