Skip to content
This repository has been archived by the owner on Mar 27, 2021. It is now read-only.

[WIP] coreopts: use clap instead of getopts #10

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Arcterus
Copy link
Collaborator

This will require some corresponding changes in the main coreutils repo. I will submit a PR shortly. Closes #9.

@Arcterus Arcterus changed the title coreopts: use clap instead of getopts [WIP] coreopts: use clap instead of getopts Jun 12, 2020
@Arcterus
Copy link
Collaborator Author

I missed a couple utilities that were still using getopts it seems. I am converting them over to coreopts and will thus likely need to add another feature or two tomorrow.

@Arcterus
Copy link
Collaborator Author

As a note of my current progress, I have gone through and converted around half of the utilities (I just finished nohup). During review, care will need to be taken to ensure that I have not accidentally broken some subtle functionality (be it due to differences between clap and getopts or simply me neglecting to do something).

@sylvestre
Copy link
Contributor

Yeah, will double check this.
This is a good case for better tests :)

@Arcterus What about pushing when one by one? will be easier to review !

@Arcterus
Copy link
Collaborator Author

Ah, I suppose one-by-one could work for some. Some of the utilities required referencing coreopts::Matches instead of getopts::Matches and thus won’t build until this PR is merged.

I was debating whether adding tests for this would be worth it, as the end goal is to switch off the current coreopts wrapper to clap proper. If we just immediately port everything over to clap, writing tests for coreopts is pretty much pointless. We should definitely add more tests for the actually utilities though, so I will try to do so.

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

Successfully merging this pull request may close these issues.

Switch backend of coreopts to clap
2 participants