-
Notifications
You must be signed in to change notification settings - Fork 1.4k
update plugin argument parsing so that execution arguments can be passed after command plugin name #6128
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
Conversation
@swift-ci smoke test |
With #6114, we have one more plugin option now. |
212993e
to
93008f9
Compare
// At this point we know we found exactly one command plugin, so we run it. | ||
try PluginCommand.run( | ||
plugin: matchingPlugins[0], | ||
package: packageGraph.rootPackages[0], | ||
packageGraph: packageGraph, | ||
options: pluginOptions, | ||
arguments: Array( remaining.dropFirst()), | ||
swiftTool: swiftTool) | ||
arguments: pluginArguments.remaining, |
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 think you want to keep passing the same Array(remaining.dropFirst())
arguments to the plugin, since the new approach is going to strip out anything that matches a swift package
flag or option. Like --verbose
could get eaten up during the re-parsing even if it has been making its way to the plugin.
…sed after command plugin name motivaiton: improve usability of command plugins changes: * re-parse the arguments that are passed after the plugin name and merge the relevant options before running the command plugin
93008f9
to
309345d
Compare
@swift-ci smoke test |
@neonichu @natecook1000 this should be ready |
// List the available plugins, if asked to. | ||
if listCommands { | ||
let packageGraph = try swiftTool.loadPackageGraph() |
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.
nice
309345d
to
0c65684
Compare
@swift-ci smoke test |
@swift-ci smoke test |
1 similar comment
@swift-ci smoke test |
motivation: improve usability of command plugins
changes: re-parse the arguments that are passed after the plugin name and merge the relevant options before running the command plugin
this allows invocation like
swift package <plugin> --disable-sandbox
(instead of the lest intuitiveswift package --disable-sandbox <plugin>