dkorunic / iSMC

Apple SMC CLI tool that can decode and display temperature, fans, battery, power, voltage and current information
GNU General Public License v3.0
122 stars 13 forks source link

Add support for JSON output format #8

Closed roele closed 2 years ago

roele commented 2 years ago

While the current output format (table) is suitable for use by humans a more technical output such as JSON would make it easier to use the tool for other purposes and extract single values for example.

Later even more formats like YAML etc. could be added as well.

dkorunic commented 2 years ago

Sorry, this will need some refactoring to be able to merge in -- do you want me to do this or you feel up to it?

roele commented 2 years ago

@dkorunic i will rebase this and get it merge ready again

roele commented 2 years ago

@dkorunic I rebased the PR incorporating your recent changes. While doing so, i took the liberty add a table title and turn the new --ascii flag into an output type ascii. Give it a spin and let me know what you think.

OT: Merging the changes was quite a struggle, it seems that VS Code does not like CGO and my entire system freezes every couple keystrokes, possibly due to regenerating CGO definitions in the background.

dkorunic commented 2 years ago

@roele Looks great, I'll merge and release ASAP! In regards to CGO, it is definitely causing pains for gopls, I agree. I tend to see slowdowns even in vim-go, although Goland works great (since it doesn't rely on gopls).

roele commented 2 years ago

@dkorunic Guess this can be closed, right?

dkorunic commented 2 years ago

Right, thanks again @roele for your patches, they've made the output and flexibility significantly better!