Type: User Story
Priority: P3: Somewhat important
Affects Version/s: None
Fix Version/s: None
Component/s: Core: Other
I've created a wrapper around QCommandLineParser which implements issue's title.
It's a common practice to load application's configuration by 2 ways:
- command line arguments
- configuration file
Each of these have benefits, so developers usually have to bother with supporting both. The thing is that it can be easily done with just one class: QCommandLineParser.
Just like QCommandLineParser supports -help option out-of-box, it could also support -config <filename> and -export <filename> options. With these 2 options QCommandLineParser could load/export options from/to a file in the background.
The class interface would stay the same for the user to add options and read values. But the user could also specify if the arguments can be loaded with an option -config (or exported with -export).
Qt has great support of JSON, so I think this is a good option here.
All app's arguments can be divided into 3 groups:
This is easily intergarted into JSON: