Improve flow for first configuration
Given that, for a first time user, (s)he:
- most likely won't ready the json schema
- will struggle to read the error from json schema parser (#16 (closed))
- make error without knowing it (misspelled and parameters are not taken into account, and it silently falls back on default value)
- will necessarily go through all parameters one way or the other
I figured that a good solution may be to require prompt input from the user for each of the parameters in the config file of the corresponding command. For instance:
$ dnadna init
> data_root ?
> root directory for all files related to the dataset, either as
> an absolute path, or as a path relative to the location of this
> config file
>> path/to/mydata # user input
>
> dataset_name ?
> a name to give the dataset; used in generating filenames and
> logging output
>> mydata
...
This has the following advantages:
- parameters cannot have typos
- parameter checking can be done right after user input, so user knows that the current input is wrong, prompt won't go farther in the config file until the parameter is properly set
- user will know what all the parameters are (same effect as reading the json schema)
- does not take more time than configuring a file for the first time
- at the end of the process, it should run smoothly (no missing parameters and other problem related to the config file).
- a clean and relevant for the user config file is generated and can be reused with the current command.
What do you think @embray ? Do you think it is doable ? If possible, we would like to have that for the release, as for now it is quite hard for newcomers to use dnadna.