For my company i am refactoring our embedded C/C++ code base to increase re-usability for commonly used functionality. Currently i am refactoring our command line interface but i ran into a design issue.
Our core command line interface is good and stable as is but in some project there is a need or wish to add additional functionality to it. For example to provide a command history or privilege levels for specific commands.
My design issue comes from the fact that some projects require only one of the extensions and others use multiple or even all.
My question: What would be appropriate approach to allow such extensibility as described above.
Currently i have looked into simple inheritance and the decorator pattern but haven't been able to make a proper design out of it. With inheritance i ran into the diamond of death and with the decorator i failed because of lack of knowledge. Maybe i am looking to much for a one fits all design where multiple different approaches maybe better.