cps-org / cps-config

A drop in replacement for pkg-config/pkgconf using cps files
MIT License
15 stars 7 forks source link

Add --help flag and usage message #48

Closed bretbrownjr closed 2 months ago

bretbrownjr commented 2 months ago

Add an initial usage and --help for the cps-config utility. The goal is to give potential contributors to this repository some idea about what the utility is for based on only looking at a --help message.

bretbrownjr commented 2 months ago

@lunacd @dcbaker cxxopts is a nice library, but I'm expecting we'll want some more powerful features sooner or later:

If you want me to open an issue first, let me know. Otherwise, don't be surprised if I revisit the UX for cps-config from the command line in a future PR. I'd still keep a simple way to serve as a drop-in replacement for pkg-config of course. Ideally, if we see argv[0] is pkg-config, that's the default operating mode. pkgconf does this and I think it's nice.

bretbrownjr commented 2 months ago

This PR was inspired by me running cps-config --help and getting a raw parsing error message instead of what you'd expect. We should also catch unexpected arguments more elegantly, but I'm thinking that's another PR. See https://github.com/cps-org/cps-config/pull/48#issuecomment-1988171269.