Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Combined output handler option #225
There may be cases where a developer may want to use an extension, for example the 'json' output handler extension which adds the '--json' command line flag, but where the developer does not want the command line option visible.
Take for instance, I want the capability to have multiple output handlers such as json, yaml, xml, html, etc. I want all these extensions enabled, but don't want all the --json, --yaml, --xml, --html options visible... I want a single --format or -f option. Such as:
I'd want to wrap all the output handlers up into a single
class MyApp(CementApp): class Meta: hide_options = ['json', 'yaml', 'xml', 'html'] # ... # do some kind of pre_argument_parsing, and post_argument_parsing # hooks to add the universal format option and to set the output_handler before # app.run() is called.
This feature would likely be a precursor to having a built-in
With the above in mind, could also just have a 'universal_output' extension... which would add the
Honestly, having the builtin output option makes sense as output handlers would very commonly be mixed with multiple types of output handlers.