Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow -appargs flag to pass flags to binary. #1534

Merged
merged 1 commit into from
Jul 6, 2022

Conversation

ianmjones
Copy link
Contributor

Resolves #1533

This change allows -appargs to pass flags to the binary when using wails dev.

This is needed because if you do not set "assetdir" in wails.json then the App created by wails dev tries to check the command line flags for -assetdir and a few more flags, and then fails when it finds the app specific flag being passed on the command line which is unknown to the flagset being used in the dev CreateApp.

The only way I could figure out to achieve this was to use a distinct FlagSet and set it to continue on error. I think this is ok as it only applies to running via wails dev, but wouldn't be too upset if someone has a better solution! 😄

There's a bonus typo fix in the help message for -appargs and gofmt fixes included for good measure too.

@leaanthony
Copy link
Member

Awesome Ian 👍 I've no better suggestions right now so let's go for it

@leaanthony leaanthony merged commit f4b4e4c into wailsapp:master Jul 6, 2022
@ianmjones ianmjones deleted the 1533-flags-in-appargs branch July 6, 2022 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wails dev -appargs does not allow for args that are flags
2 participants