diff --git a/cmd/zenity/build.sh b/cmd/zenity/build.sh index db013f4..c38e9a0 100755 --- a/cmd/zenity/build.sh +++ b/cmd/zenity/build.sh @@ -1,12 +1,12 @@ #!/bin/bash -GOOS=windows GOARCH=386 go build -ldflags="-s -w" && +GOOS=windows GOARCH=386 go build -ldflags="-s -w" -trimpath && zip -9 zenity_win32.zip zenity.exe -GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" && +GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -trimpath && zip -9 zenity_win64.zip zenity.exe -GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" && +GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -trimpath && zip -9 zenity_macos.zip zenity go build diff --git a/cmd/zenity/main.go b/cmd/zenity/main.go index 2d7b552..cb5b8ee 100644 --- a/cmd/zenity/main.go +++ b/cmd/zenity/main.go @@ -129,7 +129,7 @@ func setupFlags() { // Message options flag.StringVar(&text, "text", "", "Set the dialog text") - flag.StringVar(&icon, "icon-name", "", "Set the dialog icon (error, info, question, warning)") + flag.StringVar(&icon, "icon-name", "", "Set the dialog icon (dialog-error, dialog-information, dialog-question, dialog-warning)") flag.StringVar(&okLabel, "ok-label", "", "Set the label of the OK button") flag.StringVar(&cancelLabel, "cancel-label", "", "Set the label of the Cancel button") flag.StringVar(&extraButton, "extra-button", "", "Add an extra button") @@ -202,6 +202,16 @@ func loadFlags() []zenity.Option { // Message options var ico zenity.DialogIcon + switch { + case errorDlg: + ico = zenity.ErrorIcon + case infoDlg: + ico = zenity.InfoIcon + case warningDlg: + ico = zenity.WarningIcon + case questionDlg: + ico = zenity.QuestionIcon + } switch icon { case "error", "dialog-error": ico = zenity.ErrorIcon