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

JHOVE doesn't handle chained command line flags properly #412

Open
carlwilson opened this issue Mar 21, 2019 · 8 comments
Open

JHOVE doesn't handle chained command line flags properly #412

carlwilson opened this issue Mar 21, 2019 · 8 comments
Assignees
Labels
bug A product defect that needs fixing good-first-issue Issue suitable for inexperienced developers P1 High priority issues to be scheduled in the upcoming release

Comments

@carlwilson
Copy link
Member

JHOVE uses custom code for parsing command line parameters that doesn't support chaining flags. For example intuitively jhove -kr should enable checksumming and the use of raw data flags but this only happens if jhove -k -r is used.

@carlwilson carlwilson self-assigned this Mar 21, 2019
@carlwilson carlwilson added the bug A product defect that needs fixing label Mar 21, 2019
@marhop
Copy link
Member

marhop commented Mar 21, 2019

If you haven't already settled on something else, I really like JCommander for CLI options.

@tledoux
Copy link
Contributor

tledoux commented Mar 22, 2019

JCommander seems indeed a well-supported library to do that. It has no extra-dependencies, is Apache 2-0 license, requires Java 8.

Another library that appears when searching is picocli: no extra-dependencies, Apache 2.0 license, works with Java 5. The comparison , made by the author itself, insists in the fact that it can be integrated as source (no dependency at all) and it Supports for clustered POSIX short options, which is what this issue is about...

@marhop
Copy link
Member

marhop commented Mar 23, 2019

Oops, you're right! I thought JCommander supported clustered options, but I haven't checked in a while (seems it does not). Indeed picocli looks nice, and it even supports autocomplete.

@carlwilson carlwilson added the P1 High priority issues to be scheduled in the upcoming release label Apr 14, 2020
@carlwilson carlwilson added this to the Hack week tasks milestone Apr 14, 2020
@carlwilson carlwilson added the good-first-issue Issue suitable for inexperienced developers label Apr 23, 2020
@carlwilson carlwilson removed their assignment Apr 27, 2020
@carlwilson
Copy link
Member Author

carlwilson commented Apr 28, 2020

Hi, @DinoAGW is this the right issue to assign you to, or more accurately is this your GitHub id? I'm happy to help move this along or write some unit tests. It's a bit cheeky but if we're going to replace this with picoli then we might look at #413 as well which is related.

@DinoAGW
Copy link
Member

DinoAGW commented Apr 30, 2020

@carlwilson yes, I am. That would be great. I'm looking forward to start with making myself familiar with picoli.

@carlwilson
Copy link
Member Author

That's great @DinoAGW, I'll likely not start until tomorrow but will get a few tests written. There's some implied refactoring here as the code's not testable in its current state. It'll need a dedicated parsing class that returns some kind of config instance, at least in my head. I might need to do that as I write the tests.

@DinoAGW
Copy link
Member

DinoAGW commented Jun 10, 2020

here is a first allmost complete try to solve it.
There are a few //TODO and "tbd"s in there because I don't know Jhove, Java and englisch well enough to make everything professional by myself, but I think, it is ready to get testet.

@carlwilson carlwilson modified the milestones: Hackathon tasks , OPF Hackathon 2023 Tasks Jun 21, 2023
@carlwilson carlwilson removed this from the OPF Hackathon 2023 Tasks milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A product defect that needs fixing good-first-issue Issue suitable for inexperienced developers P1 High priority issues to be scheduled in the upcoming release
Projects
Status: No status
Development

No branches or pull requests

5 participants