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
Warn about unknown command line arguments when starting NVDA #13087
Conversation
@feerrenrut Given our discussion in #12795 you may be interested in reviewing this PR. It would be nice to add it to 2022.1 milestone as it breaks backwards compatibility. I decided against your proposal about forcing add-ons developers to use a known prefix for all arguments since while usages of additional parameters is not very common changing them would annoy users unnecessarily. |
@josephsl Given your SPL add-on is using
|
Hi, I see. At the moment I have no plans to work on SPL add-on further as I’m ending maintenance for it. The intention was to remove add-on specific command-line arguments when the app module has terminated, but looks like I may need to look at it, or perhaps remove SPL specific command-line options altogether at the cost of removing testing facilities for some features. Thanks.
|
Hi, The change in behavior for Studio add-on between Studio sessions is intentional - I have done it so the command-line parameters affect NVDA during a single Studio session. The easiest workaround that would not involve massive reengineering would be telling NVDA to use add-on specific command-line switches as long as current NVDA session is active. Also, keep in mind that Studio add-on is really a collection of app modules, so extra command-line switches will be active as long as the main Studio app module is active. If I understand the PR correctly, add-ons must tell NVDA that it needs specific parameters at startup, which may or may not be feasible for app module add-ons (certainly it will work for global plugins and drivers). One implication is that NVDA may treat a switch needed by an app module add-on as invalid until the app module loads, in which case NVDA will be told that the app module needs an invalid command-line switch or two (such is the case with Studio app module). One workaround would be for app module add-ons to ship with a global plugin whose main task would be informing NVDA of command-line switches the app module requires, unless I'm misunderstanding the PR source code text correctly. As for studio add-on, as soon as the PR is approved, I'll modify my add-on accordingly to handle old and new code paths. Thanks. |
You're right that for add-ons consisting of app modules it is necessary to bundle a global plugin which would be responsible for parsing command line arguments - I've edited the PR description to make it clear. If, for the SPL add-on the intention was indeed to use these arguments only for the first run of Studio, then source code comments should be edited and no longer talk about removing them to preserve default behavior after restart of NVDA as that is not what happens. |
Hi, that is what will happen with Studio add-on source code – I’m also making sure the extra argument is gone from sys.argv just to play safe. Thanks.
|
It would be helpful to add some system tests for this, using the example plugins, but I fear we may need to change the system test infrastructure significantly to support this. |
I believe all requested changes are now addressed though I've placed an example code in the developer guide rather than in
I don't know enough about our system testing infrastructure to be able to asses how much work it would require, however for me the main blocker for working on system tests is the fact that they rely on Windows being in English therefore I cannot execute them on my main development machine. This is something which I intent to improve at some point but honestly it's low priority for me. Is this PR going to be accepted without system tests, or do you consider them required for getting this merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've suggested some minor rephrasing to the developerGuide, but this otherwise looks good to me.
Is this PR going to be accepted without system tests, or do you consider them required for getting this merged?
The inclusion of system tests will not block this PR.
I wanted to flag that this is another instance where system tests for command line arguments would be helpful. I am going to create an issue for adding them, as it has been discussed before and it is getting more important. Once the system test infrastructure supports testing command line arguments, they will be expected for PRs like this.
I am going to perform some extensive local testing before final approval.
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Link to issue number:
Closes #12795
Summary of the issue:
When starting NVDA with unknown (not used by NVDA nor by add-ons)
command line parameters there is no warning.
Description of how this pull request fixes the issue:
Testing strategy:
these plugins in the scratchpad - inspected log to made sure that each of the plugin had a chance to process all unknown parameters, and that only parameters not used by any of them were shown as unknown.
Known issues with pull request:
None known
Change log entries:
New features
This can be potentially viewed as a change rather than new feature - I'm happy either way.
For Developers
globalVars.appArgsExtra
has been removed - if your add-on need to process additional command line arguments see documentation ofaddonHandler.isCLIParamKnown
for details.Code Review Checklist: