-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[PowerToys Run] Add Suport for Commandline arguments in Program Plugin #5791
[PowerToys Run] Add Suport for Commandline arguments in Program Plugin #5791
Conversation
The PR Is "Draft" because it needs some work to determine where the "Searchtext" should be resolved to the application / and where it would start passing the rest as arguments (E.g. Microsoft Edge is currently parsed as "Microsoft for application, Edge as arguments)). Currently two options |
What about doing it like windows search? Accept parameters only when the user enters the exe file name.
|
393eae7
to
8fc2fd3
Compare
@htcfreek i don't think this would be great, since it will not be possible to launch the programs via their description (And do all UWP programs have an .exe? Open question)) Currently i implemented in the following way.
Doing my own testing now to see how i like the feature (you can too) and will add tests for the parsers later :) |
e927fcf
to
d6fe003
Compare
What does happen if input is |
c84fdcb
to
02b3c8b
Compare
Added the tests for it as well :)
|
I think the first case should be also possible because for example chrome uses double minus for parameters. |
1a5da61
to
86f64dd
Compare
Added support for the doubledash as well (And updated the regex to make it easier to add even more but don't think that will be needed). I thought the doubledash was more of the Linux style of commandline seperators but seems it's also used on Windows, so a good suggestion 👍 |
86f64dd
to
0af21f7
Compare
@@ -1,4 +1,4 @@ | |||
// Copyright (c) Microsoft Corporation |
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.
This was a UTF8 files, but the other files in this project are UTF8 + BOM, seems like a sensible change to add?
@royvou i know you were doing some stuff here a while ago, can we test this out? |
@crutkas Yes! Latest commits were only merges to keep up with the latest master branch 😄 Tests should now also be ran by CI so that's awesome! |
@royvou |
0af21f7
to
d003693
Compare
@crutkas |
d003693
to
2050815
Compare
Rebased it on the latest master branch to resolve merge conflict on the csproj. |
Can we merge this for 0.23? @crutkas Have you tried this feature? |
...ugins/Microsoft.Plugin.Program.UnitTests/ProgramArgumentParser/ProgramArgumentParserTests.cs
Outdated
Show resolved
Hide resolved
...ugins/Microsoft.Plugin.Program.UnitTests/ProgramArgumentParser/ProgramArgumentParserTests.cs
Outdated
Show resolved
Hide resolved
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 really like this feature! Nicely done.
@crutkas i would need to inspect but since neither use a - - or - / with argument I would expect it to be part of the 'program' instead of the arguments. |
Current IProgramArgumentParser implementation assumes every keyword you type in (keywords are seperated by a space e.g. Microsoft Edge) would be part of the "Program" so
I think there's a few suggestions on how to handle it
Will update the bug you mentioned later, i think #2 / #3 are good to add. |
Summary of the Pull Request
Add support for CommandLine arguments to the Program Plugin
PR Checklist
Info on Pull Request
Adds Support for CommandLine arguments to the Program Plugin.
Validation Steps Performed