coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

pr: use clap to handle help & version

Open cakebaker opened this issue 3 years ago • 2 comments

This PR let's clap handle help and version, and removes the deprecated AppSettings::NoAutoHelp and AppSettings::NoAutoVersion.

cakebaker avatar Sep 05 '22 14:09 cakebaker

This is technically incompatible with GNU pr, because they don't accept -h and -v, but only the long options. I don't really mind that much in this case, though. If we want 100% compat, then we need disable_help_flag and ArgAction::Help on the custom flag (and the same for version).

tertsdiepraam avatar Sep 05 '22 15:09 tertsdiepraam

Hm, at least on my machine clap doesn't use -h for help because -h is already defined for something else (the CICD / Binary sizes check, however, fails because of that).

cakebaker avatar Sep 06 '22 08:09 cakebaker

Works as a charm now! Thanks for proving me wrong :)

tertsdiepraam avatar Sep 25 '22 12:09 tertsdiepraam