uucore
uucore copied to clipboard
[WIP] coreopts: use clap instead of getopts
This will require some corresponding changes in the main coreutils repo. I will submit a PR shortly. Closes #9.
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.
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).
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 !
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.