Skip to content
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

Add a CustomCommandLineArgument interface #130

Open
cmnbroad opened this issue Feb 6, 2018 · 5 comments
Open

Add a CustomCommandLineArgument interface #130

cmnbroad opened this issue Feb 6, 2018 · 5 comments

Comments

@cmnbroad
Copy link
Collaborator

cmnbroad commented Feb 6, 2018

This would be useful when the doc and possible values for an argument are not static, but derived programmatically from code. For example, an argument where the values are drawn from the cross product of two existing enums, or some subset thereof:

enum A { A1, A2 }
enum B { B1, B2, B3 }

@Argument
public List<String> crossProductArgs;

where the values of crossProductArgs are drawn from the set { "A1-B1", "A1-B2", "A2-B1", "A2-B2", "B1-A1", ... }, with hyphen as a separator.

This link is to a private repository, but for those who can navigate to it, a real life (and slightly more complicated) version of this came up in https://github.com/broadinstitute/picard-private/pull/1218.

@magicDGS
Copy link
Contributor

magicDGS commented Feb 7, 2018

Would this enable also to programmatically to restrict enums? For example, with an use-case from HTSJDK, remove support for unknown sort order to be set if the argument is a SortOrder enum?

@cmnbroad
Copy link
Collaborator Author

cmnbroad commented Feb 8, 2018

Yes, perhaps custom validation or parsing could be another use for this.

@cmnbroad
Copy link
Collaborator Author

The CommandLineProgram base class should include methods that handle some of the warning messages as implemented in broadinstitute/gatk#4429. Barclay should also include the TerminalColor some variant of class mentioned in broadinstitute/gatk#4429 (comment).

@magicDGS
Copy link
Contributor

I think that your previous comment is misplaced (it should be in #127 or #96)

@cmnbroad
Copy link
Collaborator Author

Yeah. I'll add it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants