-
Notifications
You must be signed in to change notification settings - Fork 6
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
Change the list file argument expansion extension and add a new option #95
Change the list file argument expansion extension and add a new option #95
Conversation
magicDGS
commented
Sep 22, 2017
- First commit solves Change the list file argument expansion extension from ".list" to ".args" #94
- Second commit adds an option to switch off the list parsing.
@cmnbroad - do you want to review this one? |
Codecov Report
@@ Coverage Diff @@
## master #95 +/- ##
=========================================
Coverage 75.68% 75.68%
- Complexity 576 577 +1
=========================================
Files 22 22
Lines 2159 2159
Branches 447 447
=========================================
Hits 1634 1634
Misses 350 350
Partials 175 175
Continue to review full report at Codecov.
|
If we're going to do this maybe we should just go all the way and let you specify a list of extension that will be expanded this way. Default to |
What about a
This can be also useful for broadinstitute/gatk#2596 to specify some syntax checks/enforcements on arguments (e.g., conversion to kebab-case syntax, or just check after a refactor of all arguments is done). What do you think, @lbergelson and @cmnbroad? |
@magicDGS We'd certainly take a look at a PR if you want to propose something. |
@cmnbroad - I implemented the changes in the next commit to show the idea (slightly modified from the previous description. Back to you! |
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.
@magicDGS Thanks for proposing these changes. See my inline comments - I think now might be a good time to change the way we're handling options.
* @param callerArguments The object containing the command line arguments to be populated by | ||
* this command line parser. | ||
*/ | ||
public CommandLineArgumentParser(final Object callerArguments) { | ||
this( | ||
callerArguments, | ||
Collections.<CommandLinePluginDescriptor<?>>emptyList(), | ||
Collections.<CommandLineParserOptions>emptySet() | ||
DEFAULT_PARSER_OPTIONS |
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.
Since we now want to have more complex options for things like custom expansion file extensions, I think it would be cleaner to switch over to using a configuration object that is passed in by clients. Barclay can have a default implementation, with methods like "List getExpansionFileExtensions()", and custom implementations be provided by the clients.
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.
So do you mean to use a BarclayConf
interface (or mutable object) to pass to the parser? I think that passing the options as single elements makes clear which behaviour is changing/requested...
If we are going to that direction, I can either make another commit here or open a new PR, whatever you prefer...
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 meant that instead of the CommandLineParserOption enum or interface, Barclay should have a CommandLineParserConfig class, with methods like "List getExpansionFileExtensions()" and "boolean getAppendToCollections()", with default implementations. Any customizations would be implemented by passing a config object to the constructor which is a subclass of that default implementation. Barclay would just query it; hopefully the object itself won't need any mutators.
When we just had options that were toggles, it would have been overkill, but with the need to return a custom list, this is cleaner, and will eliminate the need for type casting, etc. Reusing this PR is fine, or make a new one if its easier - either way. Thanks!
@cmnbroad - I added a commit with the |
Closing in favor of #126 |