You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a run function is defined with parameters, each of which has a default value (e.g., func run(arg: Type = defaultValue)), the function can be called via run().
Each ParsableCommand has a default run() function that outputs its help info, however, so that gets called instead of the overload with its default values.
If run() isn't specifically overridden in a subtype of ParsableCommand, but it is overloaded by another function that has default values for each of its parameters, can you autogenerate a run() that calls the defaulted overload?
This is similar to other open issues (#622 & #538), all of which stem from the default implementation of run() in ParsableCommand (see #622 (comment)).
ArgumentParser version:
1.5.0
Swift version:
swift-driver version: 1.62.15 Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
Target: x86_64-apple-macosx12.0
Checklist
If possible, I've reproduced the issue using the main branch of this package
If a
run
function is defined with parameters, each of which has a default value (e.g.,func run(arg: Type = defaultValue)
), the function can be called viarun()
.Each
ParsableCommand
has a defaultrun()
function that outputs its help info, however, so that gets called instead of the overload with its default values.If
run()
isn't specifically overridden in a subtype ofParsableCommand
, but it is overloaded by another function that has default values for each of its parameters, can you autogenerate arun()
that calls the defaulted overload?This is similar to other open issues (#622 & #538), all of which stem from the default implementation of
run()
inParsableCommand
(see #622 (comment)).ArgumentParser version:
1.5.0
Swift version:
swift-driver version: 1.62.15 Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
Target: x86_64-apple-macosx12.0
Checklist
main
branch of this packageSteps to Reproduce
Expected behavior
Prints "Ran defaulted overload"
Actual behavior
Prints help info for
command
The text was updated successfully, but these errors were encountered: