add width and height flags

This commit is contained in:
filifa 2024-09-07 20:56:02 -05:00
parent d13abec803
commit 38016be3d3
1 changed files with 5 additions and 1 deletions

View File

@ -28,6 +28,8 @@ import (
var transition bool
var softCutDuration float64
var width int32
var height int32
/*
* checkStdin checks if any data has been passed in through stdin and returns
@ -157,7 +159,7 @@ func milkbucket(cmd *cobra.Command, args []string) {
}
defer sdl.Quit()
m, err := newMilkDropWindow(800, 600, args, softCutDuration)
m, err := newMilkDropWindow(width, height, args, softCutDuration)
if err != nil {
cobra.CheckErr(err)
}
@ -205,4 +207,6 @@ func init() {
// when this action is called directly.
rootCmd.Flags().BoolVarP(&transition, "transition", "t", false, "smoothly transition between presets")
rootCmd.Flags().Float64VarP(&softCutDuration, "soft-cut-duration", "s", 3, "time in seconds for a soft transition between two presets (use with --transition)")
rootCmd.Flags().Int32Var(&width, "width", 800, "window width")
rootCmd.Flags().Int32Var(&height, "height", 600, "window height")
}