Opened 7 years ago
Closed 7 years ago
#916 closed enhancement (duplicate)
Adding --json command line option
Reported by: | yaarit | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | smartctl | Version: | 6.5 |
Keywords: | Cc: |
Description
I would like to prepare a patch to implement '--json' cmd option, as mentioned in ticket #766. I'm new to this project and would appreciate your help.
- Is it okay if I use C++11 features, even if it as little as "auto"?
- What's your opinion about using a JSON library? (specifically this one - JSON for Modern C++)
- I wish to create a data structure to hold the smart data, and print it when it's completely populated.
Do you have insights about how the data structure should look like, considering hierarchy, data order, and which containers to use?
When looking at the first chunks of output for SATA I was wondering how to represent the data, so it would be easy to traverse and print. The general idea is to have a container to represent each section, for example:
struct smart_data
{
map<string, string> info_section;
map<string, string> smart_data_section;
vector<map<string,string>> vendor_specific_attr;
more containers go here
};
Is there a certain format you prefer it to be represented?
- Is there a way to mock output from devices I don't have (such as SAS)? I wish to test this output but I don't have all of the supported disks out there...
Many thanks!
Change History (1)
comment:1 by , 7 years ago
Component: | all → smartctl |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Type: | patch → enhancement |
Hi Yaarit,
I would recommend to move discussion to the smartmontools-devel mailing list, to deal with a wider audience. Below is my personal opinion on the few topics you mentioned:
regex
andgetopt
.jq
tool.P.S. if you want to use git and github to submit your patches for review - there is an official mirror for that. Feel free to fork & PR. For discussions please use maillist, this tracker is for the bugreports. I am closing now this ticket, because we already have tickets for the JSON and i do not see a lot of sense to have duplicates.
Thank you, and lets move to the maillist