-
Notifications
You must be signed in to change notification settings - Fork 81
relm4::app::RelmApp::run_async catches cli args which causes panic #667
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
Comments
As a fellow Relm user, this is really annoying. |
Sorry for responding so late, I somehow missed the notification.
This has been the recommended approach. Relm4 hasn't tried to change the default behavior of That said, it makes more sense to me to make this more explicit. If you just build an app, add
|
That's how it used to be and I think this is the best approach. |
As title says, the
relm4::app::RelmApp::run_async
function catches the arguments, I pass to my application.I've migrated my app from
relm4
version0.5
to0.9
, and noticed that change in behavior.While I was running the app like this, and everything worked perfectly well:
After migration, this code still works... sometimes. However, after addition of
--demo
argument to application, it's been noted, that app fails to run with error:Even though
clap
read args correctly.It seems like the call to
gio::application::ApplicationExtManual::run
in arelm4::app::RelmApp::run_async
function forces the attempt to parse the arguments:which fails, since
gio
doesn't know about my app's arguments, but parses them, gets somedemo
and kills itself.In
relm4
's0.5
version, therelm4::app::RelmApp::run_async
function just calledgio
'srun_with_args
function, and it didn't trigger arguments search, which worked perfectly well.So, for now, as a dirty hack, I'm starting my application by initializing the empty args vector:
But it doesn't seem to me like a right thing to do
The text was updated successfully, but these errors were encountered: