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

Refactor CLI options parsing #248

Open
hpjansson opened this issue Feb 16, 2025 · 0 comments
Open

Refactor CLI options parsing #248

hpjansson opened this issue Feb 16, 2025 · 0 comments
Labels
tidiness Code organization and compliance
Milestone

Comments

@hpjansson
Copy link
Owner

The CLI options parsing in chafa.c has grown into a big, unwieldy and hard to follow blob. It also has all kinds of ad-hoc logic (defaults, dependent settings, etc) mixed in. We need to refactor this, preferably into its own options.c unit that can produce a struct with just the raw options.

A couple of points:

  • Every option must have an auto or unset state.
  • It should be possible to merge option structs from different sources in the future (e.g. from config file, env vars).
  • Defaults must be applied by separate logic after the options have been parsed and merged. Consider that some of the defaults may come from probing (which itself can be turned off with an option).
@hpjansson hpjansson added the tidiness Code organization and compliance label Feb 16, 2025
@hpjansson hpjansson added this to the 1.18 milestone Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tidiness Code organization and compliance
Projects
None yet
Development

No branches or pull requests

1 participant