Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions v3/cmd/wails3/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,27 @@ func main() {
app.NewSubCommandFunction("doctor-ng", "System status report (new TUI)", commands.DoctorNg)
app.NewSubCommandFunction("releasenotes", "Show release notes", commands.ReleaseNotes)

task := app.NewSubCommand("task", "Run and list tasks")
Task := app.NewSubCommand("task", "Run and list tasks")
var taskFlags commands.RunTaskOptions
task.AddFlags(&taskFlags)
task.Action(func() error {
return commands.RunTask(&taskFlags, task.OtherArgs())
Task.AddFlags(&taskFlags)
Task.Action(func() error {
return commands.RunTask(&taskFlags, Task.OtherArgs())
})
task.LongDescription("\nUsage: wails3 task [taskname] [flags]\n\nTasks are defined in the `Taskfile.yaml` file. See https://taskfile.dev for more information.")
Task.LongDescription("\nUsage: wails3 task [taskname] [flags]\n\nTasks are defined in the `Taskfile.yaml` file. See https://taskfile.dev for more information.")

generate := app.NewSubCommand("generate", "Generation tools")
generate.NewSubCommandFunction("build-assets", "Generate build assets", commands.GenerateBuildAssets)
generate.NewSubCommandFunction("icons", "Generate icons", commands.GenerateIcons)

icons := generate.NewSubCommand("icons", "Generate icons")
var iconsFlags flags.GenerateIconsOptions
iconsFlags.Input = "build/appicon.png"
iconsFlags.WindowsFilename = "build/windows/icon.ico"
iconsFlags.MacFilename = "build/darwin/icon.icns"
icons.AddFlags(&iconsFlags)
icons.Action(func() error {
return commands.GenerateIcons(&iconsFlags)
})
Comment on lines +73 to +81

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm whether flags.GenerateIconsOptions exists and how it relates to commands.IconsOptions
fd -t f . v3/pkg/flags 2>/dev/null | xargs -r grep -n "GenerateIconsOptions" 
echo "---"
rg -n "type GenerateIconsOptions" v3/pkg/flags
echo "---"
rg -n "func GenerateIcons\(" v3/internal/commands
echo "---"
rg -n "type IconsOptions struct" -A 10 v3/internal/commands/icons.go

Repository: wailsapp/wails

Length of output: 1161


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate the main file and related flag/command definitions
git ls-files 'v3/**' | sed -n '1,200p' | rg '^(v3/cmd/wails3/main.go|v3/.*/flags|v3/.*/commands/icons.go|v3/.*/icons.go)$'

echo "--- main.go ---"
sed -n '1,140p' v3/cmd/wails3/main.go

echo "--- files mentioning GenerateIconsOptions or IconsOptions ---"
rg -n "GenerateIconsOptions|IconsOptions|GenerateIcons\(" v3

echo "--- candidate flag definitions around the generate-icons area ---"
rg -n -A 12 -B 6 "GenerateIconsOptions|iconsFlags|GenerateIcons\(" v3/cmd v3/internal v3/pkg

Repository: wailsapp/wails

Length of output: 15703


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "--- internal/flags files ---"
git ls-files 'v3/internal/flags/*'

echo "--- GenerateIconsOptions definition ---"
sed -n '1,220p' v3/internal/flags/*.go | rg -n -A 20 -B 5 "type GenerateIconsOptions|type .*Icons|default:|description:"

echo "--- commands/icons.go struct and defaults ---"
sed -n '1,80p' v3/internal/commands/icons.go

echo "--- any alias to commands.IconsOptions ---"
rg -n "type GenerateIconsOptions\s*=" v3/internal/flags v3/internal

Repository: wailsapp/wails

Length of output: 5813


Use commands.IconsOptions here

v3/internal/flags doesn’t define GenerateIconsOptions, so var iconsFlags flags.GenerateIconsOptions won’t compile. Bind the subcommand directly to commands.IconsOptions (or add a real alias in v3/internal/flags). The hardcoded defaults here also duplicate the default: tags on commands.IconsOptions; keeping a single source of truth would avoid drift.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@v3/cmd/wails3/main.go` around lines 73 - 81, The icons subcommand is binding
to a non-existent flags type, so switch the `icons` setup in `main` to use
`commands.IconsOptions` directly instead of `flags.GenerateIconsOptions`. Keep
the `icons.AddFlags` and `icons.Action` wiring, but make sure the command reads
from the `commands.IconsOptions` struct so it compiles. Also remove the
duplicated hardcoded default values in this setup and rely on the `default:`
tags on `IconsOptions` as the single source of truth.


generate.NewSubCommandFunction("syso", "Generate Windows .syso file", commands.GenerateSyso)
generate.NewSubCommandFunction("runtime", "Generate the pre-built version of the runtime", commands.GenerateRuntime)
generate.NewSubCommandFunction("webview2bootstrapper", "Generate WebView2 bootstrapper", commands.GenerateWebView2Bootstrapper)
Expand Down Expand Up @@ -209,4 +219,4 @@ func openDocs() error {
func openSponsor() error {
commands.DisableFooter = true
return browser.OpenURL("https://github.com/sponsors/leaanthony")
}
}
8 changes: 4 additions & 4 deletions v3/internal/commands/icons.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ func (e *macAssetNotSupportedError) Error() string {

type IconsOptions struct {
Example bool `description:"Generate example icon file (appicon.png) in the current directory"`
Input string `description:"The input image file"`
Input string `description:"The input image file" default:"build/appicon.png"`
Sizes string `description:"The sizes to generate in .ico file (comma separated)" default:"256,128,64,48,32,16"`
WindowsFilename string `description:"The output filename for the Windows icon"`
MacFilename string `description:"The output filename for the Mac icon bundle"`
WindowsFilename string `description:"The output filename for the Windows icon" default:"build/windows/icon.ico"`
MacFilename string `description:"The output filename for the Mac icon bundle" default:"build/darwin/icon.icns"`
IconComposerInput string `description:"The input Icon Composer file (.icon)"`
MacAssetDir string `description:"The output directory for the Mac assets (Assets.car and icons.icns)"`
}
Expand Down Expand Up @@ -367,4 +367,4 @@ func GenerateTemplateIcon(data []byte, outputFilename string) (err error) {
}

return nil
}
}
2 changes: 1 addition & 1 deletion v3/pkg/icons/icons.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ var WailsLogoBlackTransparent []byte
var WailsLogoWhite []byte

//go:embed WailsLogoWhiteTransparent.png
var WailsLogoWhiteTransparent []byte
var WailsLogoWhiteTransparent []byte
2 changes: 1 addition & 1 deletion v3/pkg/w32/icon.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,4 +264,4 @@ func SetMenuIcons(parentMenu HMENU, itemID int, unchecked []byte, checked []byte
return nil, err
}
return handles, nil
}
}
Loading