Skip to content

Shell::Option demolition - #921

Open
MichaelRawson wants to merge 9 commits into
masterfrom
michael-options
Open

Shell::Option demolition#921
MichaelRawson wants to merge 9 commits into
masterfrom
michael-options

Conversation

@MichaelRawson

Copy link
Copy Markdown
Contributor

Shell::Options had grown over a decade or so and become quite convoluted. Straighten it out a bit:

  • Move most of the implementation details to Options.cpp so it doesn't bother every other translation unit.
  • Thereby remove some extraneous #includes in the header.
  • Use const char * rather than std::string for option names (since they are all statically known), and various other de-heapifications.
  • Re-implement the OptionValueConstraint<T> system - you can still write exactly the same expressions, but without the evil AbstractOptionValueConstraint/WrappedConstraint headache.
  • Options::init() is now just Options()
  • OptionValue<T> no longer has a scary default constructor that does...something. This was only necessary because options were not initialised in Options().
  • Remove some completely-unused fields and options, and wire some in properly that were used but never initialised (eek!).

I'm not sure what the best way to review this is, as it amounts to a rewrite. Maybe I'll just grab @quickbeam123 at some point and inform him of its various virtues.

@MichaelRawson MichaelRawson changed the title Michael options Shell::Option demolition Aug 31, 2026
@MichaelRawson

Copy link
Copy Markdown
Contributor Author

At least on my compiler this hacking seems to have allowed a reasonable release compile time for Shell/Options.cpp again, so I've removed the no-optimise compiler pragma.

@MichaelRawson
MichaelRawson force-pushed the michael-options branch 4 times, most recently from a783540 to e30c145 Compare September 8, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant